DM22, Spring 2006 - Weekly Note 7

Note: The lecture on March 28 will take place from 11:00 to 12:00.


Lecture March 21

Trees. Handout of first project (pdf).

Reading

Sections 6.1, 6.2, 7.3.1, and 7.4.1. Slides (trees.hs).


Lecture March 28 (Expected contents)

Modules. Type inference. Efficiency.

Reading

Section 8.2. Handouts. Chapter 7.


Exercises March 29

Any remaining exercises from last weekly note.

Make functions flatten, mapTree, and foldTree for the datatype BSTree a from the slides (trees.hs).

Make a function which implements a DFS traversal for the datatype BSTree a (Hint: if you go for at linear time solution, Section 7.3.2 may be inspirational (rose trees are defined in Section 6.4)).

Make a function which implements a BFS traversal for the datatype BSTree a (Hint: first consider making a function which takes a list of trees, and returns a (a tuple consisting of) the list of roots and the list of subtrees of the roots).

Exercise 6.1.6 in Bird.

Exam of summer 2004 (pdf), exercise 3.


Maintained by Rolf Fagerberg (rolf@imada.sdu.dk)