logoalt Hacker News

torginusyesterday at 2:02 PM2 repliesview on HN

>What are skiplists good for

In practice, I have found out, nothing much. Their appeal comes from being simpler to implement than self-balancing trees, while claiming to offer the same performance.

But they completely lack a mechanism for rebalancing, and are incredibly pointer heavy (in this implementation at least), and inserts/deletes can involve an ungodly amount of pointer patching.

While I think there are some append-heavy access patterns where it can come up on top, I have found that the gap between using a BST, a hashtable, or just putting stuff in an array and just sorting it when needed is very small.


Replies

senderistayesterday at 11:10 PM

Lock-free BSTs or b-trees exist only in research papers, but lock-free skiplists are straightforward to implement.

CyberDildonicsyesterday at 5:42 PM

You're right, but it's not popular to go against the premise of a post.