Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Finger Search [10 points] [2 A finger in a skiplist is an array that stores the sequence of nodes on a search path at which
Finger Search [10 points] [2 A finger in a skiplist is an array that stores the sequence of nodes on a search path at which the search path goes down. (The variable stack in the add(x) code on page 87 is a finger; the shaded nodes in Figure 4.3 show the contents of the finger.) One can think of a finger as pointing out the path to a node in the lowest list, L0. A finger search implements the find (x) operation using a finger, walking up the list using the finger until reaching a node u such that uxx and then performing a normal search for x starting from u. It is possible to prove that the expected number of steps required for a finger search is O(1+logr), where r is the number values in L0 between x and the value pointed to by the finger. Design, i.e. provide the necessary pseudo code for, a version of a skiplist that implements f ind (x) operations using an internal finger. This subclass stores a finger, which is then used so that every find (x) operation is implemented as a finger search. During each f ind (x) operation the finger is updated so that each f ind (x) operation uses, as a starting point, a finger that points to the result of the previous f ind (x) operation
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