SkiplistSSet: An Efficient SSet
Explore the SkiplistSSet data structure that implements sorted sets using skiplists. Understand how to efficiently add, find, and remove elements with expected logarithmic time complexity. Learn about the underlying search path, height selection using pickHeight, and practical implementation details like stack use for insertion and immediate removal during search.
We'll cover the following...
A SkiplistSSet uses a skiplist structure to implement the SSet interface. When used in this way, the list stores the elements of the SSet in sorted order.
The find() method
The find(x) method works by following the search path for the smallest value such that :
Following the search path for is easy: when situated at some node, u, in , we look right to u.next[r].x. If x > u.next[r].x, then we take a step to the ...