Besides arrays and linked lists

In the memory array which is continuous, stationary.
Benefits: You may know the memory address is the number of fixed positions, such as from the beginning of the first element 00, so where is the 10th element in? Do not look know is 09.
Disadvantages: fixed length, if more than the length, you need a whole to another contiguous space for expansion operations.

After the list in memory is not continuous, each element stores a memory address elements.
Benefits: add elements very convenient, do not care where the address is not continuous.
Disadvantages: find elements very hard, you need to find one by one along.

So the next time ask the difference between ArrayList and LinkedList can proceed from the difference between the array and the list go on

Guess you like

Origin blog.csdn.net/weixin_34178244/article/details/90839085