Java Collection Framework (ii)--linkedlist

Source: Internet
Author: User

Third, linked list--linkedlist

  

Although ArrayList is useful, arrays and array lists have a major flaw: Deleting an element from the middle of an array costs a great price because all elements in the array that are behind the deleted element are moved to the front end of the array. However, LinkedList with a linked list structure does not have this problem.

The underlying structure of LinkedList is a doubly linked list of similar data structures, which can be used to increase and delete elements at a relatively small cost.

  

LinkedList has an inner class that implements the function of a doubly linked list.

1. Construction method

LinkedList ()

Constructs an empty list. The construction method is nothing special.

2. Common methods

  

Java Collection Framework (ii)--linkedlist

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.