Answered step by step
Verified Expert Solution
Question
1 Approved Answer
[ 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
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started