Second, the linear form

(Content supplemented)

Linear table (Linear List ) from the n (n> 0) wherein the same data elements (nodes) of finite sequences.

 

  • Linear characteristics of the logical structure table , the table for the linear non-empty:
    1. there is only one start node a1, no direct predecessor.
    2 has only one endpoint node an, there is no immediate successor.
    3. The rest of the internal node ai (2≤i≤n-1) and only has a direct predecessor an-1 and an immediate successor an + 1.
    (Ps: the circular list is also a linear logical hierarchy table belongs (chain stores storage hierarchy), but the tail pointer points to the last data element of the first node)

  • Linear form basic operations : construction, destruction, empty, empty sentence, rectification, according to the value of the bit sequence, targeting by value, by value to find, before becoming seek, seeking successor, insert, delete, modify.

  • Linear table is a logical concept, mainly represented by a sequence (table sequence) or represents a chain (linked list). In practice, often used in a special form of the stack, queue, string and the like.


Sequence table (Sepuential List) : with a set of addresses contiguous memory locations storing a linear list of data elements.

List (Linked List)  with a set of memory cells to store any of the data elements of the linear form, the list is not necessarily the same logical order in the physical order. In order to correctly represent logical relationships between nodes at the same time each storage node values, must also store address information indicating its successor node (called a pointer or a chain).

  • Circular list: a single linked list, the null pointer field to point to the start of the terminal node. Analyzing conditions empty list head == head -> next;

  • Doubly linked lists:  doubly linked by a chain of two different directions, i.e. each node other next field contains the successor node address, but also a pointer to increase the field prior to its predecessor. If it is the end to end bi-cyclic chain.

     

    (Ps: bidirectional linked list insertion cycle, a new node must first disconnect the link of the original node.)

                 q->prior=p;q->next=p->next;p->next->prior=q;p->next=q;

     

    Storage density (Storage Density)  refers to the amount of memory occupied by the data itself and the entire storage node structure occupied ratio, namely: a storage density = (own node data storage) / (total amount of memory occupied by the node structure);

    • Sequence table storage density = 1; list storage density <1.


Guess you like

Origin www.cnblogs.com/makelin/p/12146279.html
Recommended