Java record-50-Comparison and Analysis of ArrayList and rule list

Source: Internet
Author: User

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.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.