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% (2 reviews)
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.
-
Historical data at Acme Manufacturing estimate a 5% chance that a batch of widgets will be unacceptable (bad). A bad batch has 15% defective items, and a good batch includes only 4% defective items....
-
The Longo Corporation issued \(\$ 50\) million maturity value of six percent coupon rate bonds, with interest paid semiannually. At the time of the bond issuance, equivalent risk-rated debt...
-
Nolan Company deposits all cash receipts on the day when they are received and it makes all cash payments by check. At the close of business on June 30, 2013, its Cash account shows an $ 22,352 debit...
-
Consider the following information: Probability of Rate of Return if State Occurs Economy State of Economy Stock A Stock B Recession .20 .035 -.40 Normal Boom .60 .20 .115 .30 .290 .53 a. Calculate...
-
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.
-
The ethyl acetate concentration in an alcoholic solution was determined by diluting a 10.00-mL sample to 100.00 mL. A 20.00-mL portion of the diluted solution was refluxed with 40.00 mL of 0.04672 M...
-
Joe Boylan purchased 600 common shares of Standard Cartons Inc. at the start of the year for $140 per share. He went on vacation in July and on his return was surprised to see that the shares were...
-
Reflection on A Real-Life Executive Compensation Scheme: Please skim through the articles below, you can refer to other academic/reliable articles:...
-
1. Two firms bid for a contract to build a university building. Their construction costs are independent and uniformly drawn from [0, 1]. Both bidders submit their bids si- multaneously. The winner...
-
What roles do the primary and second markets play in the current economy? What is the relationship between financial markets and financial institutions? How could the relationship run smoother?
-
The expected dividends for the next 3 years are given: D 1 = 1 . 8 , D 2 = 2 , D 3 = 3 . from the third year, the dvidends are expected to grow at a constant rate of % 8 . If the discount rate is % 4...
-
The following data pertain to three divisions of Calrisian Enterprises. The companys required rate of return on invested capital is 8 percent. Required: Fill in the blanksabove. Division I Division...
-
Tell whether the angles or sides are corresponding angles, corresponding sides, or neither. AC and JK
-
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?
-
Future value interest factor of $1 per period at i% for n periods, FVIF(i,n). 1 1.0050 1.0100 1.0150 2 1.0100 1.0201 1.0302 3 1.0151 1.0303 1.0457 4 1.0202 1.0406 5 1.0253 1.0510 1.0773 6 1.0304...
-
After extensive medical and marketing research, Pill, Inc., believes it can penetrate the pain reliever market. It is considering two alternative products. The first is a medication for headache...
-
According to BIS 117 section 2.2, what are some of the ways a tech company can close information gaps and reduce expenses? A) Reducing fixed and marginal costs of producing financial services. B)...
Study smarter with the SolutionInn App