Add exercises for chapter 4. Finished task 4 and 5.

In addition, modify the binary search tree code to support duplicate
item in tree.