Data Structure and algorithm introduction notes

Source: Internet
Author: User

Program Design = Data Structure + Algorithm

Data structure:It is a set of one or more specific relationships between data elements. (The relationship refers to the logical structure, and the set refers to the physical structure );

A. Logical Structure
Set: there is only one set of data elements.
Linear Structure: there is a one-to-one relationship between data elements.
Tree Structure: One-to-multiple relationship exists between data elements.
Graphical structure or mesh structure: there are multiple to multiple relationships between data elements

B. Physical Structure (storage structure)
Sequential storage: data elements are stored in address-contiguous storage units. The logical and physical relationships between data are consistent (arrays)
Chained storage: data elements are stored in any storage unit. These storage units can be continuous or non-continuous.
Algorithm:It is a description of the steps to solve a specific problem. In a computer, it is represented by a finite sequence of commands, and each command represents a single active multiple operations. This is just a trick and a way to solve the problem.

A. algorithm features:
Input parameters
Output, can be printed, and can return values
After a finite step is completed, each step is completed within an acceptable period of time.
Certainty, each step has its definite meaning, and there will be no ambiguity, under certain conditions
Execute the same execution path. The same input can only have unique output results.
Feasibility each step can be completed through a limited number of executions

B. algorithm design requirements:
The algorithm program has no syntax error.
Valid input can produce output that meets requirements
Invalid input can produce descriptions that meet specifications
All testing inputs that are intentionally difficult have output results that meet the requirements.
Readability: easy for others to read and modify.
Robustness: when the input is invalid, relevant processing can be performed instead of crashing.
High time efficiency and low storage capacity
Gaussian algorithm

Data Structure and algorithm introduction notes

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: 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.