- Home
- Interview Questions
- Data structures and Algorithms
A skip list is a data structure for storing a sorted list of items, using a hierarchy of linked lists that connect increasingly sparse subsequences of the items. These auxiliary lists allow item lookup with efficiency comparable to balanced binary search trees.
Because they allow arbitrary insertions, but arbitrary insertions do not necessarily result in sorted lists.
The speed of random access lookups in a skip list can be improved by using an indexable skiplist. To index the skiplist and find the i-th value, the skiplist must be traversed and the widths of each traversed link must be counted down.
An unrolled linked list is a linked list in which each node contains an array of data values. This leads to improved cache performance, since more list elements are contiguous in memory, and reduced memory overhead, because less metadata needs to be stored for each element of the list.
- findPosition - used to find the position of an object in the sorted list
- operator [] - used to access the object at a given position in the sorted list
- withdraw - used to remove the object at a given position from the sorted list