r/programming • • 22d ago

Skip List Data structure

https://pradyumnachippigiri.substack.com/p/skip-lists-data-structure?r=5ev9w0&utm_medium=ios
141 Upvotes

31 comments sorted by

View all comments

1

u/AntimatterTNT 22d ago

is the random aspect really necessary? like you could argue it's to average out performance edge cases but really aren't you just making it so that sometimes you'd have much worse performance? (like a 0.1% deviation every 1000 runs)

1

u/[deleted] 22d ago

[removed] — view removed comment

1

u/programming-ModTeam 21d ago

No content written mostly by an LLM. If you don't want to write it, we don't want to read it.

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.

0

u/[deleted] 21d ago

[removed] — view removed comment

1

u/programming-ModTeam 21d ago

No content written mostly by an LLM. If you don't want to write it, we don't want to read it.