Complete the implementation of the Skip List-based dictionary begun in Section 16.3.1. Section 16.3.1: 16.3.1 Skip Lists
Question:
Complete the implementation of the Skip List-based dictionary begun in Section 16.3.1.
Section 16.3.1:
Transcribed Image Text:
16.3.1 Skip Lists Skip Lists are designed to overcome a basic limitation of array-based and linked lists: Either search or update operations require linear time. The Skip List is an example of a probabilistic data structure, because it makes some of its decisions at random. Skip Lists provide an alternative to the BST and related tree structures. The pri- mary problem with the BST is that it may easily become unbalanced. The 2-3 tree of Chapter 10 is guaranteed to remain balanced regardless of the order in which data values are inserted, but it is rather complicated to implement. Chapter 13 presents the AVL tree and the splay tree, which are also guaranteed to provide good per- formance, but at the cost of added complexity as compared to the BST. The Skip List is easier to implement than known balanced tree structures. The Skip List is not guaranteed to provide good performance (where good performance is defined as (log n) search, insertion, and deletion time), but it will provide good perfor- mance with extremely high probability (unlike the BST which has a good chance of performing poorly). As such it represents a good compromise between difficulty of implementation and performance. Figure 16.2 illustrates the concept behind the Skip List. Figure 16.2(a) shows a simple linked list whose nodes are ordered by key value. To search a sorted linked list requires that we move down the list one node at a time, visiting (n) nodes in the average case. Imagine that we add a pointer to every other node that lets us skip alternating nodes, as shown in Figure 16.2(b). Define nodes with only a single pointer as level 0 Skip List nodes, while nodes with two pointers are level 1 Skip List nodes. To search, follow the level 1 pointers until a value greater than the search key has been found, then revert to a level 0 pointer to travel one more node if necessary. This effectively cuts the work in half. We can continue adding pointers to selected nodes in this way - give a third pointer to every fourth node, give a fourth pointer to every eighth node, and so on- until we reach the ultimate of log n pointers in the first and middle nodes for a list of n nodes as illustrated in Figure 16.2(c). To search, start with the bottom row of pointers, going as far as possible and skipping many nodes at a time. Then, shift up to shorter and shorter steps as required. With this arrangement, the worst-case number of accesses is (log n).
Fantastic news! We've Found the answer you've been seeking!
Step by Step Answer:
Answer rating: 100% (QA)
Answered By
Pushpinder Singh
Currently, I am PhD scholar with Indian Statistical problem, working in applied statistics and real life data problems. I have done several projects in Statistics especially Time Series data analysis, Regression Techniques.
I am Master in Statistics from Indian Institute of Technology, Kanpur.
I have been teaching students for various University entrance exams and passing grades in Graduation and Post-Graduation.I have expertise in solving problems in Statistics for more than 2 years now.I am a subject expert in Statistics with Assignmentpedia.com.
4.40+
3+ Reviews
10+ Question Solved
Related Book For
Practical Introduction To Data Structures And Algorithm Analysis Java Edition
ISBN: 9780136609117
1st Edition
Authors: Clifford A. Shaffer
Question Posted:
Students also viewed these Computer science questions
-
Graph each hyperbola. y 16 x 16 || 1
-
Carol Harris, Ph.D, CPA, is a single taxpayer and she lives at 674 Yankee Street, Durham, NC 27409. Her Social Security number is 793-52-4335. Carol is an Associate Professor of Accounting at a local...
-
The following additional information is available for the Dr. Ivan and Irene Incisor family from Chapters 1-5. Ivan's grandfather died and left a portfolio of municipal bonds. In 2012, they pay Ivan...
-
Valuing Preferred Stock Best Rate Bank just issued some new preferred stock. The issue will pay a $10 annual dividend in perpetuity, beginning 10 years from now. If the market requires a 7 percent...
-
Prove that a cyclic device that violates the KelvinPlanck statement of the second law also violates the Clausius statement of the second law.
-
The house is not owned by an engineer, and the car is not run by electric power and the heat is solar generated. Let p: The house is owned by an engineer. q: The heat is solar generated. r: The car...
-
Diageo North America, Inc., the owner of the Bulleit brand family of whiskeys, sued competitor W.J. Deutsch & Sons Ltd. for allegedly infringing upon the trade dress of Diageos Bulleit bottles....
-
Tsang, Inc., is considering the sale of two bond issues. Choice A is a $1,600,000 bond issue that pays semiannual interest of $128,000 and is due in 20 years. Choice B is a $1,600,000 bond issue that...
-
A clinical resear would like to know if his diet program is effective in lowering patients blood pressure. The following patient. Blood pressure before diet blood pressure after diet 1. 15. 12 2. 15....
-
Implement both a standard \(\Theta\left(n^{3}ight)\) matrix multiplication algorithm and Strassen's matrix multiplication algorithm. Using empirical testing, try to estimate the constant factors for...
-
Write a function to find the \(i\) th node on a Skip List.
-
How do we go about determining the orders in an experimental rate law? Use the term kinetics experiments in your answer, defining what those are.
-
Can you help me reword and help organize this paragprah. The () are the comments and corrections that needs to be fixed. Addley, Esther. "'It's Tough for Parents': Should Young Children Have Their...
-
suppose you are 29 years old and currently living in the USA but your mom lives in Bangladesh. Both you and your mom have not lived together for almost 9 years. you are missing your mom a lot....
-
Matching Question Match the IFRS debt instrument category with the corresponding US GAAP category with similar accounting treatment. Amortized Cost Amortized Cost drop zone empty. Fair value through...
-
Collectibles have the potential for short-term capital growth. Question 32 options: True False
-
Evaluate the arguments by Stossel and Rodgers. Is the evidence credible? How do you know? How does the evidence support the claims? How did your opinion form or change after reading both sides of...
-
Suppose Ramirez Ltd. Just issued a dividend of $1.89 per share on its common stock. The company paid dividends of $1.47, $1.62, $1.67, and $1.78 per share in the last four years. If the stock...
-
The area of a rectangle is 30 cm 2 and its perimeter is 26 cm. Find the length and width of the rectangle.
-
A stream of data is being carried by STS-1 frames. If the data rate of the stream is 49.530 Mbps, how many frames per second should leave one empty byte after the H3 byte?
-
What are the four SONET layers?
-
What is the minimum number of cells resulting from an input packet in the AAL5 layer? What is the maximum number of cells resulting from an input packet?
-
Mary is an accountant and having an annual income of $400,000. She plans to open a bookstore and quitting her job. She has her own shop and the annual rent is $148,000. She expects the annual revenue...
-
Considering retail price is 100% consisting both cost and initial markup, a salesperson presented The Wonderland Bookstore, a store that carries Lewis Carroll memorabilia, an opportunity to stock...
-
Compare between Autocratic and Supportive management behavioural models.?
Study smarter with the SolutionInn App