[] Data structures and algorithms (1) Architectural Overview




I. Overview

Data structure is stored in the computer, data is organized. Data structure refers to the presence of one or more data elements of the particular relationship between each set. Typically, the data structure may be carefully selected to bring higher operational or storage efficiency. Data structure often associated with efficient retrieval algorithms and indexing techniques.

Simple to understand, learning data structure to learn how data is stored.

Second, the role

In order to facilitate the latter part of the re-use of data

Data structure effect: In order to facilitate the re-use of the latter part of the data .

Example:

  • We have a set of numbers {1, 2, 3, 4, 5}. We can use an array to store data (sequence table structure). Late easy re-use of the data.

  • However, if this data?

    There have complex relationships of the data, at this time, or if an array for storage, is clearly unwise. The data storage is no problem, but can not reflect the logical relationships between data, not easy to use again. Remember that data storage is irresponsible behavior missed by storage space .
    For the above type of data herein, there is provided a data structure in a special tree structure for storing such data.

We learn the data structure is to learn: how to store data with complex relationships, to facilitate the re-use of the latter part of the data .


Third, the logical structure and physical structure

1. The logical structure of the data

It refers to a data structure reflecting the logical relationships between data elements, wherein the logic means between before and after the relationship between the data elements, regardless of their location stored in a computer.

Logical structure comprising:

  • Set: between the data structure elements in addition to "belong to a set of" correlation, no other relations;
  • Linear structure: to-one correlation between the data structure elements;
  • Tree structure: there is a correlation in many of the data structure elements;
  • Graph structure: there is a correlation-many data structure elements.

It refers to the relationship between the logical structure of the data and the data (the relationship between the logical storage computer storage, and independent). For example, a parent and child relationship. The relationship between the family tree of each person (data) teacher student relationship.

2. The physical structure of data (also called storage structure)

It refers to a logical structure data stored in the form of computer memory space.

The physical structure of the data is represented by a data structure (known as an image) in the computer, which machine comprises a data-element represents the relationship between the machine and FIG. Because of various orders, links, indexing, hashing and other concrete implementation, therefore, may be represented as a data structure stored in one or more structures.

It is the data structure in a computer memory (or storage structure called a physical structure). A data structure (logical structure data) can be expressed as one or more storage structures. That is, a data structure with one or more are stored in the computer.


Fourth, the classification

There are various data structures, in general, according to its logical structure data of the simple classification, including linear and nonlinear structural configuration types.

There are a variety of data structures, which is above the logical structure of the data speaks of four. But in general it became a simple classification into two categories: linear and nonlinear structure structure.

1. The linear structure

Briefly, the linear structure of the table is a linear relationship between the respective nodes. If the language to describe the data structure, linear structure should include the following points:
  1, a non-linear structure empty set.
  2, only a linear structure and a start node and end node.
  3, the structure of all nodes are linear up to a chemotactic nodes immediately preceding and only a direct successor node.
Linear table is a typical linear structure, as well as stacks, and a string queues belong linear structure.

Is linear structure, the data structure elements in the presence of one to one relationship . Such as: one-dimensional array, the stack, the queue are all linear structures.

2. nonlinear structure

Briefly, having a plurality of non-linear structure is a correspondence between each node in the table. If the language to describe the data structure, linear structure should include the following points:
  1, a non-empty set nonlinear configuration.
  2, a node structure may have a plurality of non-linear direct predecessor nodes and a plurality of direct successor nodes.
In practice, arrays, generalized table, tree structure and data structure of nonlinear structure.

It is the nonlinear structure, the data structure elements in the presence of a plurality of corresponding relationship . Such as: two-dimensional and multi-dimensional array, generalized tables, trees, graphs.

Fourth, the common data structure

In computer science, the development process, the data structure also will be developed. Programming common data structures include the following

  • Array (Array)
  • List (Linked List)
  • Stack (Stack)
  • Queue (Queue)
  • Tree (Tree)
  • Figure (Graph)
  • Heap (Heap)
  • Hash table (Hash)

These are some of the common data structures, program design, we will often use.

Common data structure explanatory information, please see Baidu Encyclopedia: Data Structure


Five commonly used algorithms

Study on the content data structure: is how certain logical structure, organize data, and select the appropriate method of the memory stores a logical structure of the organized data to the computer's memory.
Purpose of this study was to more efficient processing of data, data to improve the operation efficiency.
Computed data is defined in the logical structure data, but the specific implementation of the operation to be performed on the storage structure. Generally have the following common operations:
  (1) retrieval. Retrieval is to find nodes that satisfy certain conditions in the data structure. It is typically given a value for a field, to find a node having the field value.
  (2) is inserted. To add a new data structure node.
  (3) be deleted. The specified node is removed from the data structure.
  (4) update. Values of one or more fields to change the specified node.
  (5) order. The nodes according to some specified order rearranged. For example incremented or decremented.


to sum up

These are the notes while learning data structures and to share my understanding, if it helps welcome thumbs up to you, you are very welcome to my attention, I am continuing update.

If deficiencies, hope or private letter message correction.

reference

Architectural Overview: http: //data.biancheng.net/intro/

Data structure Baidu Encyclopedia: https: //baike.baidu.com/item/%E6%95%B0%E6%8D%AE%E7%BB%93%E6%9E%84/1450 fr = aladdin # 4?

Related

Data Structures and Algorithms [] (0) Outline

Published 103 original articles · won praise 121 · views 10000 +

Guess you like

Origin blog.csdn.net/weixin_44034328/article/details/104086851