Question: [ Goodrich - Tamassia, C - 3 . 2 3 , C - 3 . 2 4 , p . 2 1 5 ] Let
GoodrichTamassia, C C p Let be a Splay Tree consisting of the sorted keys :dots,: Consider arf arbitrary sequence of successful searches on items in Let be the access frequency of in Assume each item is searched at least once ie for each n
a Show that the total execution time for sequence on the Splay tree starting with is
Hint: Modify the potential function by redefining the weight of a node as the sum of access frequencies of its descendants including itself.
b Design and analyze an algorithm that constructs an offline static ie fixed Binary Search Tree consisting of the same items :dots,: such that depth of item in is Your algorithm should take at most time, and for an extra credit, it should take time. Hint: Let be the root, where is the smallest index such that dots Recurse on that idea over the subtrees.
c How do parts a and b above compare the execution times over the access sequence s on the online selfadjusting Splay tree versus the offline static binary search tree
Hint: You may also consult CLRS AAW, and my EECS Lecture Note and Slide on Knuth's dynamic programming algorithm that constructs the optimal static binary search tree.
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
