CIS 680: Mid Term Exam
Mo, May 3, 1999, 50 minutes
Open Notes, Open Books
The exam consists of seven problems
Answers not appearing in designated spaces WILL NOT be graded
read( n ) for i = 1 to n do for j = 1 to i do write( i, j )
T(n) =
Consider the linear time algorithm for initializing max heaps. Show all
the intermediate, and final, trees the algorithm creates on the given
tree.
Consider the priority queue represented by the given height-biased leftist
tree. Show the modified tree under each of the following operations.
(Note: The two operations are independent. Each of them starts from the
above tree.)
________________________________________
Insertion of the key 7.
Deletion of the largest key.
Show the modified tree under each of the following operations. (Note: The two operations are independent. Each of them starts from the above tree.)
________________________________________
Deletion of the key 5
Insertion of the key 10.
Consider the following red-black tree (the red nodes are double circled). What kind of discrepency (Lb0, RRb, etc.) each of the following operations create.