Why is there not a concurrent TreeMap? [closed]

Why there is the non-concurrent TreeMap on one side and the ConcurrentSkipListMap on one other?

I suspect this was done because making a tree structure concurrent was too difficult or suffered from locking performance problems. In terms of ordered collections, SkipLists are very simple data structures and provide similar behavior and performance to trees so the ConcurrentSkipListMap (and Set) might have been easier to make concurrent.

I’m actually more disappointed that there isn’t a non-concurrent SkipList collection myself.

Is it safe to say that a SkipListMap included a TreeMap?

No. It is safe to say that a SkipList gives similar features in terms of an ordered collection of items that gives O(logN) performance for lookup, insert, delete, etc.. At least it gives a probabilistic approximation of that performance.

Here’s a good page about skiplists. They are extremely cool data structures. I can only hope the are taught in modern programming data structures classes.

Leave a Comment