First stage: Java Internal skills cheats-linear table

Source: Internet
Author: User

Objective

Why learn data structures and algorithms, if you learn to do Android, Javaweb, front-end, etc., are your martial arts cheats, but if your internal strength is not good enough, then the Kungfu is in vain.

Data structures and algorithms: what is a data structure, what is it, the data inside the computer is 01010101 ... , data is all things in our lives can be expressed as data, such as you and your friend chat is data, the content of the friend Circle is also content.

A data structure is a relationship between one or more specific relationships, and data, that exist between them. Data structures are either one-to-one or one-to-many relationships.

ER diagram, Entity Association diagram. The relationship between data and data, divided by:

    • Graphic structure
    • Tree-shaped structure
    • Linear structure
    • Collection structure

The shape of the circle does not represent the same elements, are different small circles oh ~

There are also two storage structures:

Sequential storage structure and chained storage structure

Abstract data types

So what is an abstract data type, a numeric model, and a set of operations defined on the model, the data type is the same set of properties, and the actions defined on this collection.

Linear table

Linear table, linear structure, table structure.

There are two different ways to store a linear table

Sequential storage linear table storage location continuous, easy to query each element. The advantages are more efficient when looking for, but less efficient at insertion and deletion.

Chain-stored linear table, for the list of stored cells can be continuous, or discontinuous, in the chain to store contained data and next->data .

P p1=new P();p1.data = "data";P p2=new P();p1.data = p2;

For a chained storage structure, the advantage is that the insertion and deletion efficiency is high and the query efficiency is low.

Advantages and disadvantages of chained and sequential storage

The advantages of sequential storage linear tables are more efficient when they are found, but are less efficient at insertion and deletion.

For a chained storage structure, the advantage is that the insertion and deletion efficiency is high and the query efficiency is low.

Circular link List

The circular link list is a kind of chain storage structure , its last node points to the head node, forming a ring, which is called a single-loop linked list, referred to as the circular link list.

From any node in the loop list, it can find other nodes, the operation of the circular list and the operation of the single-linked list is the same, the difference is that the algorithm in the loop condition is different.

two-way circular linked list is also called double-linked list , is a one-way circular linked list in each node, and then set a pointer to its predecessor node of the field, a doubly linked list is one of the linked list.

Conclusion
    • This article mainly explains the Java internal strength cheats-linear table
    • Below I will continue to learn more about Java, Android, and I am interested to continue to focus on

First stage: Java Internal skills cheats-linear table

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.