Basic concept and algorithm analysis of data structure

Source: Internet
Author: User

First, the basic concept of data structure

1. Data : Data is a symbolic representation of an objective thing, in computer science refers to all the symbols that can be entered into a computer and processed by a computer program.

2. Data Elements : Data elements are the basic unit of data, which is usually considered and processed as a whole in computer programs. A data element can consist of several data items. A data item is an indivisible minimum unit of data.

3. Data Objects: A Data object is a collection of data elements of the same nature, and is a subset of the data, such as an integer data object.

4. Data structure: The data structure is a collection of one or more specific relationships between each other. According to the different characteristics of the relationship between data elements, there are usually the following 4 basic structures: (1) set, (2) linear structure, (3) tree structure, (4) A graph structure or a network structure.

The form of the data structure is defined as: The data structure is a two-tuple

Data_structure = (D, S)

Where: D is a finite set of data elements, and S is a finite set of relationships on D.

5. Logical Structure: the definition of the above data structure is a mathematical description of the object being manipulated. A "relationship" in a structure definition describes a logical relationship between data elements and is therefore referred to as a logical structure.

6. Physical Structure: The representation of a data structure in a computer (also known as an image) is called the physical structure, also known as the storage structure.

The relationship between data elements has two different representations in the computer: sequential and non-sequential, resulting in two different storage structures: sequential storage structure and chained storage structure.

7. abstract Data type: abstract data type (ADT) refers to a mathematical model and a set of operations defined on the model. can be subdivided into 3 types: Atomic type, fixed aggregation type, variable aggregation type.

Second, algorithm and algorithm analysis

1. algorithm: The algorithm is a description of the specific problem solving steps, it is a finite sequence of instructions, each of which represents one or more operations, in addition, an algorithm has the following 5 important features:

(1) have poor sex. An algorithm must always end after executing a poor step, and each step can be completed within a poor time.

(2) certainty. Each instruction in the algorithm must have the exact meaning that the reader understands without generating two semantics. And, under any conditions, the algorithm has only one execution path, that is, the same output can only be obtained for the same input.

(3) feasibility. An algorithm can be done, that is, the operations described in the algorithm can be implemented by the implementation of the basic operation of a finite number of times to achieve.

(4) input. 0 or more inputs.

(5) output. One or more outputs.

2. Requirements for algorithmic design

Usually designing a "good" algorithm should consider achieving the following objectives:

(1) correctness.

(2) readability.

(3) robustness.

(4) Efficiency and low storage demand.

3. measurement of algorithmic efficiency

Two ways to measure time complexity:

(1) The method of post-mortem statistics.

(2) Methods of pre-analysis and estimation. The time it takes for a program written in a high-level programming language to run on a computer depends on the following factors:

① based on the algorithm to choose what strategy;

The scale of the ② problem;

③ Writing Program language, for the same algorithm, the higher the level of language implementation, the less efficient execution;

④ the quality of the machine code produced by the compiler;

⑤ the speed at which the machine executes instructions.

Complexity of space.

Basic concept and algorithm analysis of data structure

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.