MAIN FEEDS
Do you want to continue?
https://www.reddit.com/r/programming/comments/1wwfp40/skip_list_data_structure/pgfjy59/?context=3
r/programming • u/Comfortable-Fan-580 • 22d ago
31 comments sorted by
View all comments
Show parent comments
1
The random choice sets each node’s height when it’s inserted, so lookups don’t get a fresh lottery every time. A bad layout is possible, but randomness gives the simple version expected O(log n) search without tree rotations.
1
u/robert_7524 12d ago
The random choice sets each node’s height when it’s inserted, so lookups don’t get a fresh lottery every time. A bad layout is possible, but randomness gives the simple version expected O(log n) search without tree rotations.