Learning notes for Java collections

Source: Internet
Author: User

Unknowingly also to the Java collection of this chapter of learning, which is a very important chapter, because all programs are inseparable from data, and a good data structure and algorithm should be the soul of the program.

A summary of what you have learned today:

The data structure is the way that the computer stores and organizes it. A data structure is a collection of elements that have one or more specific relationships to each other. Typically, a well-chosen data structure can lead to higher operational or storage efficiency. data structures are often associated with efficient retrieval algorithms and indexing techniques. (PS: From the Sogou encyclopedia)

In some programming languages, it does not write these data structures of different performance, so the people who use these programming languages can only implement the algorithm of data structure, but in the Java language, Java has a different performance data structure to the encapsulated Java collection, This allows programmers to not step through the data structure of the algorithm, just according to their own needs to choose the best data structure.

Several data structures that are simple to understand:

    • Arrays: The ability to query and replace quickly, but for larger arrays (changing the index of elements, and possibly generating expansion) and deleting (possibly altering the index of elements) can degrade performance;
    • Linked list (LinkedList):

A list element in a single necklace table contains: A saved content, a node pointing to the next list element;

There is a node in the doubly linked list that points to the last linked list element;

The advantage is that you can increase and remove elements faster.

    • Queue: Queue is FIFO, queue can add elements at the end, head delete elements;
    • Stack (stack): Advanced, the last element of the stack is called the top of the stack, the first element added is called the low stack, filled with the element called the stack;
    • Hash table (HashTable): a corresponding relationship exists between the value of the array and the index ———— (there is a relationship) ———— value

Its greatest advantage is that it improves query efficiency and that the elements it saves are not allowed to be duplicated.

...................

I do not systematically learn about the data structure of knowledge, these are hearsay, and so on after the stability, must be good to fill this knowledge.

Learning notes for Java collections

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.