Introduction to the first chapter
1.1 What is a data structure
The main content of data structure research:
The data structure is a subject of the computer operation object and the relation and operation between them in the programming problem of non-numerical computation.
1.2 Basic concepts and terminology
• Data: All the symbols that can be entered into the computer and processed by the computer are computer-operated
the general name of the elephant.
• Data element: A basic unit of data consisting of several data items, also called nodes, elements,
vertex or record.
• Data item: is the smallest unit of data that is inseparable, sometimes called a domain (field), that is, a data table
field.
• Data object: A collection of data elements of the same nature, which is a subset of the data, such as uppercase letters
The character data object is set C = {' A ', ' B ', ' C ',......, ' Z '}, the integer data object is set {0,±1,± 2, ...}.
• Data structure: Refers to a collection of elements that have one or more relationships with each other. Number
the relationship between elements is called a structure.
four basic data structures:
(1) Collection: Data elements "belong to one set".
(2) Linear structure: one to one, such as linear table, stack, queue.
(3) tree structure: A pair of multiple, such as a tree.
(4) Graphic structure: Multiple to multiple, as shown.
the form definition of the data structure:
data-structure = (d,s)
D: Finite set of data elements;
a finite set of relationships on S:d.
For example: In computer science, the plural is preferable to the following definition:
a complex number is a data structure
complex= (c,r)
where C is a set of two real numbers {C1,c2};r={p},p is a relationship defined on set C {<c1,c2>}, in which the ordered even <c1,c2> representation C1 is the real part of the complex, and C2 is the imaginary part of the complex number.
logical Structure of data: reflects only the logical relationships of data elements.
data Storage (physical) structure: the logical structure of the data is stored in the computer memory (or image).
element/node: A bit string used to represent the bits (bit) of a data element.
data field: A bit string used to represent the bits (bit) of a data item.
Example: (321) 10= (501) 8= (101000001) 2
a= (101) 8= (001000001) 2
The storage structure is divided into:
Sequential Storage structure: Represents the logical relationship between data elements by means of the relative position of elements in memory
Chained storage structure: Represents a logical relationship between data elements by means of pointers that indicate the storage address of an element