CS 302 - Data Structures

Fall 2016

Programming Assignment 7: Red-Black Tree

Due on Tuesday, Dec 13 at 4 pm

Programming Problem 3 on Page 628. Remember that Chapter 19 slides provide details of how to implement red-black tree.

  1. Randomly generate 1,000 unique values in the range of [1-10,000] and insert them into a red black tree. Print height of the tree.
  2. Print sum of all values in the tree (should use one of the traversals).
  3. Clear the binary search trees. Print whether trees are empty before and after clear operation.

Note: You can omit any operation that is not required for the above steps.


  1. Source code for your classes
  2. Doxygen reports for code documentation
  3. A main file that tests the classes with above steps.
  4. Test output of your codes.

Teaching Assistant:Iman Vakili

What to turn in: A softcopy of your sourcecode and reports should be uploaded to WebCampus. Compress all files as a single zip file.