CSE 2320 Lab Assignment 4 Due December 2, 2011 Goals: 1. Understanding of top-down red-black trees. 2. Understanding of recursive binary tree processing. 3. Understanding of subtree sizes in binary search trees for supporting ranking queries. 4. Understanding of tombstones as a simple mechanism for supporting deletions in a data structure. Requirements: 1. Modify the provided C code for maintaining a red-black tree to process a sequence of commands (standard input) from the following list: 0- Exit the program 1 x- Insert positive integer key x , unless x is already present in the tree. Besides inserting the key, subtree sizes must be updated. (Processing a duplicate x is handled as an update, even though there is no satellite data. Updates may still trigger color flips, which in turn may trigger violations of structural property 3.) 2 x- Logically delete the item for positive integer key x by using a tombstone. If there is no item, then the operation is ignored. 3
This is the end of the preview. Sign up
access the rest of the document.