Data structure C # language version Chapter 1 Introduction (1)

Source: Internet
Author: User

Data types can be divided into two types: non-structured atomic type and structure type. The composition of the structure type can make non-structured or structured.

Data structure)

A Data Structure is a collection of data elements that have one or more specific relationships with each other. In any problem, data elements are not isolated, but have a certain relationship. This relationship is called Structure ). Based on the different characteristics of the relationship between data elements, there are usually four types of basic data structures:

(1) Set: the data element in the structure has a "Same Set" relationship, and there is no other relationship.

(2) Linear Structure: the data elements in this Structure have a one-to-one relationship.

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

(4) Graphic Structure: the data elements in this Structure have many-to-many relationships.

Data storage structures include sequential and chained storage structures.

The Sequence Storage Structure expresses the logical relationship of data elements by the relative position of data elements in computer memory, generally, logically adjacent data elements are stored in storage units adjacent to physical locations. Because the storage space allocated by data is continuous, arrays are inherently capable of realizing the data sequential storage structure.

The Linked Storage Structure does not require logical adjacent data elements to be stored in the same location. The Data Element in the chain storage structure is called a Node. An Address Domain is set near the Node to store the Address of the Node adjacent to the Node to realize the logical relationship between the nodes. This address is called Reference, and this address is called Reference Domain ).

The main criteria for evaluating an algorithm are as follows: www.2cto.com

1. correctness execution results meet the most important and basic requirements

2. readability for reading and communicating

3. strong robustness and fault tolerance

4. Run Time

5. Occupied Space

Generally, the size of the storage Space temporarily occupied by an algorithm during running is called Space Complexity ). The space complexity of the algorithm is relatively easy to calculate. It mainly includes the storage space occupied by local variables and the storage space occupied by the stack used by the system for recursion.

The Time Complexity of an algorithm is the correspondence between the algorithm running Time and the problem scale. To make it easier to compare different algorithms of the same problem, the number of times (frequency) of repeated basic operations in the algorithm is usually used as the time complexity of the algorithm.

If an algorithm does not have a circular statement, the execution frequency of basic operations in the algorithm is irrelevant to the problem scale n and is recorded as O (1), also known as the constant order. If an algorithm has only one loop, the execution frequency of the basic operations of the algorithm increases linearly with the problem scale n. It is written as O (n), also called linear order.

 

From xufei96's column

Related Article

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.