Exercises for Week 10

Exercise 0

  1. At the top right and at the bottom right of the present page, there is a clickable word, “index”, to access the index of the current version of the lecture notes. Click on it and then peruse the index, making sure that its entries make sense to you (otherwise, click on them to check them out).
  2. The lecture notes start with updates (Chapter Lecture Notes for Intro to CS, updates). Make sure to check them out regularly, as they reflect the development of the lecture.
  3. Time permitting, do peruse the lecture notes of this week, reproducing their OCaml content.

Mandatory exercises

  • Exercise 1: implementing right-to-left polymorphic lists
  • Exercise 4: computing the weight of any given binary tree of integers
  • Exercise 5: testing whether a given binary tree of integers represents a well-balanced mobile
  • Exercise 11: implementing map_binary_tree using fold_binary_tree

Version

Completed [28 Mar 2021]

Created [27 Mar 2021]

Table Of Contents

Previous topic

Generic programming with binary trees

Next topic

YSC1212 Lecture Notes, Week 11