Java record-50-Comparison and Analysis of ArrayList and rule list
Comparison and Analysis of ArrayList and ArrayList use array implementation at the underlying layer, and two-way linked list implementation at the underlying layer. Because of their different underlying implementation principles, many operations differ greatly in performance. When performing the insert or delete operation, it is better to use the sort list. You only need to find the specified location and do not need to move a large number of nodes. The storage of all nodes is not always close to each other, but can be found through pointers. When performing a search operation, it is better to use ArrayList. nodes in the array are stored in the same location. When storing fixed types of nodes for search, you can find the specified location through computation. When an object is added to the ArrayList, the reference of this object is actually placed in the array maintained at the bottom layer of the ArrayList. When an Object is added to the explain list, an Entry Object is generated in the explain list. The structure of the Entry Object is as follows: Entry {Entry previous; Object elements; Entry next ;} element elements of the Object type is the element we added to the listing list. Then, the Entry constructs the previous and next references both forward and backward, finally, add the generated Entry object to the linked list. In other words, Entry objects are maintained in the comment list.