Sorted linked list + random express lanes → O(log n) search without balancing. Step through search: jump right, drop a lane when overshot. Insert: height via…
Why it matters
A skip list gives O(log n) search, insert and delete on average like a balanced tree, with no rotations or colours: only pointers per lane. Redis uses it for sorted sets, LevelDB and RocksDB for memtables. Its order is kept, so ranges are easy, which a hash table cannot do.
The key idea
A coin instead of rebalancing
Common mistakes
Assuming a skip list is guaranteed fast every time It is expected O(log n), not worst case. Unlucky coins can make it an O(n) linked list, but the odds shrink exponentially.
Wondering why not just use a hash table A skip list keeps ORDER, so ranges and sorted walks are easy. A hash table finds in O(1) but has no order.
Looking for the rebalancing code in a skip list and not finding it There is none: balance comes from the coin toss on insert. No rotation or recolouring; insert and delete only link and unlink pointers per lane.
Try it in this playground
Search by the aqueducts Compare the plots checked with a plain list.
Insert a plot 2 lanes high or more Watch its coin and each lane being linked.
Pull a plot One relink per lane it stands on.
Search with an unlucky coin Without aqueducts, it is a plain list.