EXERCISES ON BINARY SEARCH TREES
1. (Sedgewick, Exercise 12.33). Draw the binary search trees (as in Figure 12.3)
corresponding to the comparisons in binary search for N = 17 and N = 24.
2. Draw the BST that results when you insert items with keys
E A S Y Q U E S T I O N
in that order, into an initially empty tree.
3. Write a C function that prints all the keys less than a given value k
in a BST.
4. Write a C function that returns the number of items in a BST with
key equal to a given key. (Sedgewick, Exercise 12.49)
5. Write a C function that determines whether a given binary tree
is a binary search tree.