We have Linked Lists for Easy to insert & delete in O(1) time and we don’t need to estimate total memory needed .But we have some drawbacks of Linked List too i.e. in Linked list it is hard to search in less than O(n) time and hard to jump to the middle for eg. binary search doesn’t work.
So to fix these drowbacks we have Skip list that has good data structure for a dictionary ADT. Skip list was invented around 1990 by Bill Pugh. It is a generalization of sorted linked lists so simple to implement . Expected search time in Skip list is O(log n).It has randomized data structure that uses random coin flips to build the data structure.
Here is the example of perfect skip list because it has-
Header & sentinel nodes are in every level
When search for k:
If k = key, done!
If k < next key, go down a level
If k ≥ next key, go right
In other words we can say to find an item, we scan along the shortest list until we would “pass” the desired item. At that point, we drop down to a slightly more complete list at one level lower.
Get Answers For Free
Most questions answered within 1 hours.