Algorithm Summary (2) Data Structure

Source: Internet
Author: User

Data Structure)

It refers to a set of data elements that have (exist) a certain relationship (relationship) between each other. The relationship between elements is called the logical structure.

There are four basic types of logical structures between data

Set: the data element in the structure has no relation except "belong to the same set.

Linear Structure: there is a one-to-one relationship between data elements in the structure.

Tree Structure: there is a one-to-many relationship between data elements in the structure.

Graph structure or mesh structure: There is a many-to-many relationship between the data elements in the structure.

 

 

 

Data structure storage method

The storage of data structures in computer memory includes the storage of data elements and representation of the relationship between elements.

There are two different Representation Methods for the relationship between elements in the computer: Sequential Representation and non-sequential representation. Two different storage structures are obtained: sequential Storage Structure and chained storage structure.

--- Ordered storage structure: the logical structure (relationship) between data elements is expressed by the relative position of data elements in the memory ).

Chain Storage Structure: Add a pointer to each data element to store the address of another element. This pointer is used to represent the logical structure (relationship) between data elements ).

 

Logical and physical structures

 

Data Structure Calculation

The main operations of the data structure include:

(1) create a Data Structure

(2) destroy a Data Structure

(3) Delete A data element from a data structure;

(4) Insert a data element into a Data Structure

(5) access a Data Structure)

(6) modify a data structure (Data Element in) (modify)

(7) sort a data structure (SORT)

(8) search a data structure ).

Linear table

 

Sequential storage of linear tables

 

 

Chain storage of linear tables

 

Two-way linked list

 

 

Two-way linked list node and its type definition

 

 

Stack and queue

 

 

Basic concepts of stack

 

 

Stack sequential storage Representation

 

Stack chain storage Representation

 

Stack applications

 

Queue

 

Cyclic queue

 

 

Queue chain representation and implementation

 

Tree and binary tree

 

Tree Definition

 

Basic Terms of the tree (1)

 

Basic Terms of the tree (2)

 

.....

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.