Algorithms and Data Structures (INF1, Autumn'05)

Exercise Set 9



Exercise 1:



Exercise 2 (hand-in):

Consider the following sequence of operations on a symbol table s using the binary search tree implementation from the lecture.

s.make
s.insert(s.new_entry(4,"Peter"));
s.insert(s.new_entry(2,"Jan"));
s.insert(s.new_entry(7,"Peter"));
s.insert(s.new_entry(5,"Jiri"));
s.insert(s.new_entry(6,"Anna"));
s.insert(s.new_entry(8,"Peter"));



Exercise 3:

Consider binary search trees as defined at the lecture.


Exercise 4:

Draw all binary search trees with exactly three nodes that store the keys 4, 7 and 8. The values stored in the nodes are irrelevant.