One.
Focus on the ArrayList and LinkedList query the reasons for the speed, both additions and deletions have been introduced.
The array is a contiguous space, placed in the heap memory, and the elements are placed inside the array.
Explain why queries for arrays are fast (all relative) and why the list queries are slow.
In heap memory, much of the data is randomly placed, but if a part is stored as an array, it is stored in a corner label. Querying on successive sections is faster than searching in many random locations. However, if it is additions and deletions, then the operation of the array is reaching, the whole is to be adjusted, because the array is as a whole to appear.
The following shows the memory distribution of the linked list structure, the reason why the deletion is fast is shown below, but the 98-point element is still in memory, but not in the list structure. Why is the list structure query slow, because the overall memory is not a list structure, or loose. Therefore, the query is relatively slow (in fact, some of them do not speak).
Does the element in the LinkedList have a corner mark? It is a sub-class of the list interface, the most important feature of the list interface is the corner label, its subclass is all.
The array is a contiguous space, plus numbering. The list is not a continuous space, it is also labeled. It is said here that continuity and discontinuity may be said to mean the distribution. The list distribution may not be contiguous, although the links are together.
Java-preliminary Understanding-Common Object API (collection framework-arrays and linked lists)