why LinkedList doesn't have initialCapacity in java?

前端 未结 6 1010
不知归路
不知归路 2021-02-07 00:54

I wonder why LinkedList doesn\'t have initialCapacity.

I know good when to use ArrayList and when LinkedList.

6条回答
  •  别跟我提以往
    2021-02-07 01:50

    Its model is not based on an array but rather a true linked list, and so there is no need and further it would not make sense. It doesn't make much sense to have empty links like you have empty array items.

提交回复
热议问题