Basic concepts and terminology understanding of data structure (C language version-Min textbook)

Source: Internet
Author: User

————————————————————————————————————————————

Basic concepts and terminology

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

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

Data elements: is the basic unit of data, which is usually considered and processed as a whole in computer programs.

data item: A data item is an indivisible minimum unit of data, and a data element consists of several data items.

Example: In a bibliographic search, each book's information is a data element, and each of the books is information (title / author ...). ) is a data item.

data object: is a collection of data elements of the same nature, and is a subset of the data.

structure: The relationship of data elements to each other.

A collection of data elements that exist in one or more specific relationships with each other. Basic structure: Set, linear structure, tree structure, graph structure and net structure. The purpose of the discussion data structure is to implement it in the computer, so it is also necessary to study how to represent it in the computer

form definitionof data structure: Data_structure = (D, S); where D is a finite set of data elements, S is a finite set of relationships on D.

Example: The group consists of 1 teachers, 1-3 graduate students and 1-6 undergraduates, the teacher instructs the graduate student, the postgraduate instructs 1-2 undergraduates to define the following data structures:

Logical Structure: a "relationship" in a structure definition describes a logical relationship between data elements, the logical structure.

storage structure (physical structure): The representation of a data structure in a computer (also known as an image). Includes two aspects:1. representation of data elements 2. representation of the relationship

Element (node): a bit string formed by combining several bits to represent a data element, which is the element. Can be seen as an image of a data element in a computer

data fields: when data elements are made up of several numbers

Two representations of the relationship between data elements in a computer and the corresponding storage structure:

Sequential image-- sequential storage structure : Represents a logical relationship between data elements, such as a one-dimensional array, with the relative position of the element in memory

non-sequential images -chain storage structure : Represents a logical relationship between data elements, such as a pointer, with a pointer indicating the storage address of the element

Virtual Storage structure: The storage structure discussed in data structure is the representation of data structure in C virtual processor, so it is called virtual storage structure.

// Example: If you want to represent a conjugate complex 3.0-2.3i , in a sequential storage structure, with addresses adjacent to the 4 a string of word lengths, in a chained storage structure 3.0 bits are stored behind a pointer to the -2.3 the Address 0415 the pointer,

data type: is a collection of values and a generic term that defines a set of operations on this set of values. Example: The value set of an int integer is an integer on an interval, and the operation defined on it is an arithmetic operation such as subtraction and modulo.

Data types fall into two categories:

    1. Non-structured atomic type: not decomposed
    2. struct type (fixed aggregate type + variable aggregation type): It is made up of several costs according to a certain structure, its composition can be non-structural or can be structural.

A data structure can be thought of as a set of values with the same structure, whereas a struct type can be thought of as consisting of a data structure and a set of operations defined on it.

multi-shape data type: The data type whose value is not determined by the component. From the perspective of an abstract data type, it has the same mathematical abstraction characteristics. Note: A C + + implementation is required

abstract data type ( Adstract Data Type,adt): refers to a mathematical model and a set of operations defined on the model. and data types are essentially a concept. A software module with an abstract data type should typically contain three parts:1. definition 2. represents 3. Implement

Divided into the following three types:

    1. Atomic type: ibid., example: Int,char
    2. Fixed aggregation type: Its value consists of a certain number of components in a structure. Example: The complex number is composed of two real numbers in the order of determination
    3. mutable Aggregation Type: the bibliography of the constituent of its value is indeterminate compared to the fixed aggregation type. Example: An abstract data type that defines an ordered sequence of integers with variable lengths.

An abstract data type can be represented by a ternary group: (d,s,p)

ADT abstract data type name

{

Data Objects :< definition of a data object >

Data Relations :< definition of data relationship >

Basic Operations :< definition of basic operation >

basic operation name (parameter table) // two parameters:1. Assignment Parameters: provide input values for operations only 2. Reference parameter: Starting with & , in addition to providing input values, returns the result of the operation

Initial conditions:< initial condition description > // describes the conditions that the data structure and parameters should meet before the operation executes, and if not, the operation fails and returns an error message.

operation Result:< operation result description > // The change of data structure after normal operation and the result should be returned.

...

Basic operation name (parameter table)

Initial conditions:< initial condition description >

operation Result:< operation result description >

} ADT abstract data type name

Cases:

Abstract data type definition of ternary group (left)

Representation of abstract data type triplet (right)

Code implementation:

————————————————————————————————————————————

Basic concepts and terminology understanding of data structure (C language version-Min textbook)

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.