CIS 680: Mid Term Exam
Mo, October 25, 1999, 50 minutes
Open Notes, Open Books
The exam consists of seven problems
Answers not appearing in designated spaces WILL NOT be graded
(a)
for i := 1 to n do for j := 1 to n2 do for k := 1 to n3do a[i,j,k] := 0(b)
function comp(n) { if n < 2 then return 1 return comp( n / 2 ) }
(a)
Solve the following recurrence equation exactly.
T(n) =
(b)
Does the solution to the following recurrence equation equal to, smaller than, or greater than the solution to the equation of (a).
T(n) =
___________
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 a 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 4
Insertion of the key 16.
Consider the following red-black tree (the red nodes are double circled). What kind of discrepancy (Lb0, RRb, etc.) each of the following operations create. (Note: The different operations are independent. Each of them starts from the above tree.)