C # Data Structures

Source: Internet
Author: User

A data structure is a collection of elements that have one or more specific relationships to each other. In any problem, the data elements are not isolated, but there is a certain relationship, this relationship is called structure (Structure). There are typically 4 basic data structures based on the different characteristics of the relationships between data elements:

(1) Set: The data element in the structure has no relationships other than the one that belongs to a set.

(2) linear structure (linearstructure): There is a one-to-one relationship between data elements in this structure.

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

(4) Graph structure (graphicstructure): There are many-to-many relationships between the data elements in this structure.

The formal definition of a data structure is:

Data structure (data Structure) précis-writers for DS, is a two-tuple, ds = (d,r)

Where: D is a finite set of data elements,

R is a limited set of relationships between data elements.

The data structure includes the logical structure and the physical structure. The data structure is defined as the logical structure (logic Structure), the logical structure of the data is abstracted from the specific problem of mathematical model, is to discuss the convenience of the problem, and the data in the computer is not related to the specific storage. However, we discuss the data structure in order to implement it in the computer, so we also need to study how to represent and store the data structure in the computer, that is, the physical structure (physical Structure). The physical structure of the data, also known as the storage structure (Storage Structure), is the representation (aka image) and storage of data in a computer, including the representation and storage of data elements, and the representation and storage of relationships between data elements. The storage structure of data includes two kinds of sequential storage structure and chain storage structure. The sequential storage structure (Sequence Storage Structure) is a table based on the relative position of the data element in the computer memory

The logical relationship of the data elements is shown, and the logically adjacent data elements are stored in the adjacent storage unit of the physical location. The sequential storage structure is implemented in the C # language using arrays. Since the storage space allocated by the array is contiguous, the array is inherently capable of implementing the data order storage structure. The chained storage structure (Linked Storage Structure) is logically adjacent to the data element that does not require its storage location to be contiguous. The data element in a chained storage structure is called node, which is attached to the Address field (Addressdomain) in the node to store the address of the node adjacent to the node to achieve the logical relationship between nodes. This address is referred to as a reference (Reference), which is referred to as the Reference field (Reference domain).

C # Data Structures

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.