Linear structure
1. A unique linear relationship is met between data elements.
2. Each data element (except the first and last) has only one direct predecessor and one direct successor.
Linear table (sequential table, linked list, stack, queue)
1. The simplest and most common form of data structure
2. A finite sequence consisting of n data elements (nodes)
Sequential table
1. The data elements of the linear table are stored in logical order in a set of true storage units of the address.
Linked list (unidirectional linked list, doubly linked list, circular link list)
1. The data elements of a linear table, in addition to storing their own information, need a pointer to store the indicator's successor, storing the position.
2. The storage structure of a node is a linked list of data|next,n nodes.
Stacks (Stack)
1. Linear table with insert and delete operations limited to one end of the table
2. Follow the LIFO (last on first out) principle
Queue (Quene)
Divided by storage: Sequential queue, chain queue, ring queue
1. Element insertion is only allowed at one end of the table, and element deletion at the other end
2. Follow the FIFO first out principle
Nonlinear structure
Tree-shaped structure
1. There is a distinct hierarchical relationship between data elements, and each element is related only to one element in the previous layer (parent node) and to multiple elements in the lower level (child nodes)
Binary tree (binary tree, full two fork tree, complete binary tree, optimal binary tree)
Partitioning by storage: sequential storage structure, chained storage structure
1. Each node has a maximum of two children, and its subtree has an ordered tree of left and right points.
2. Conform to three major properties (specific follow-up article description)
Pattern structure (graph)
Traversal mode: Depth-first search traversal, breadth-first search traversal
Storage structure: adjacency matrix notation, adjacency table notation
1. The relationship between the nodes is arbitrary.
2. Special tree-shaped structure
Multidimensional arrays
Divided by memory representation: row vector, column vector
1. Generalization of linear tables
2. Because the memory structure of the computer is unique, the two-bit data is represented by a row vector or a column vector
Generalized tables
Node data structure: Tag|data/slink|link
Tag: Used to distinguish whether the current node is an atom or a child table.
Data/slink storing atomic data or sub-table addresses
Link stores the address of the node corresponding to the next element
1. Non-linear structure with hierarchy
2. Often use chained storage structures
3. Each node is comprised of three fields, where tag is a flag bit that distinguishes whether the current node is an atom or a child table.
Data structure Note 1 overview