Why can't I set the initial capacity for ConcurrentSkipListMap?

Why don't ConcurrentSkipListMap constructors allow us to set initial capacityhow HashMap does?

+5
source share
1 answer

Since this data structure is supported by several LinkedList , for which the initial capacity constructor parameter does not matter.

HashMap is supported by an array (contiguous memory space), for which it makes sense to set the initial capacity, because overflowing the initial size of this table causes HashMap to redistribute the new table with the increased size, which is very expensive.

+6

All Articles