CS 302 - Data Structures

Spring 2015

Programming Assignment 7: Scheduling via Interval Tree

Due on Thursday, Apr 30 at 9:00 am

Implement an interval tree for scheduling different events using a red-black tree (as explained in the lectures). Your implementation should be able to add an event and look up events for a particular time frame.

Note that you are not required to implement event removal or other tree actions that are not required for the scheduling (i.e., event addition and event lookup).

Your main program should read a list of events listed as

start1 end1
start2 end2
start3 end3
...
and insert them into an interval tree one by one. It should then print an pre-order traversal of the tree (in which nodes' level is indicated). Finally, it should ask the user for an interval and search for an overlapping interval.

Bonus: Identification of all events that overlap with a given time frame (2 points). Removal of an event from the schedule (7 points).

Deliverables:

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

Teaching Assistant:M.A. Canbaz

What to turn in: A softcopy of your sourcecode and reports should be uploaded to WebCT. Do not compress as a zip file or combine as a tar file.