Common data structures

Data -> Organize Analysis (Algorithms + Data Structures) -> Information

  1. Basic data types (Primitive Data Type)
    scalar data type (Scalar Data Type)
    integer, floating point, boolean, character
  2. Structured data types (Structured Data Type)
    virtual data type (Virtual Data Type)
    strings, arrays, pointers, lists, files
  3. Abstract Data Types (Abstract Data Type)
    Stack
  • Array - Array / List (Python)
    Two-dimensional a Dimension
  • List - Linked List
    same data type, the table linearly arrayed in a specific order.
    Position of the list items in the computer memory is discontinuous and random (the Random) stored.
    Single Linked List unless necessary immovable list head pointer.
  • Stack - Stack
    same data type ordered linear combination LIFO table abstract data type (ADT)
    1. Create create
    2. Push push
    3. Pop pop
    4. Is empty isEmpty
    5. It is full full
  • Queue
    FIFO ADT ordered linear table abstract data type (ADT)
    Breadth First Search (BFS)
    stack need only a top (top), the stack pointer to point to the top
    of the columns must have two front and rear and the front of the queue pointers point to the end of the queue end
    1. Create create
    2. Add add
    3. Delete delete
    4. The front end of the front return value
    5. Is empty empty
  • Tree
    binary space partitioning trees (BSP tree)
    quadtree (Quadtree)
    octree (an Octree)
    n-ary tree (n-way)
    between a legitimate tree nodes can be connected to each other, but can not be formed without the outlet loop.
    1. Each node number of all subtrees: degree (Degree).
    2. The number of layers (Level)
    3. Height (Height): maximum number of layers of the tree.
    4. Leaf / node terminal (Terminal Nodes): node 0 degrees.
    5. Parent (Parent)
    6. Child node (Children)
    7. Ancestor (Ancestor) and sons (Descendent)
    8. Sibling node (Siblings)
    9. Non-terminal node (Nonterminal Nodes)
    10. Same generation (Generation): nodes having the same number of layers in the tree.
    11. Forest (Forest): n trees (n ≥ 0) of a set of mutually exclusive tree.
    • General tree structure are stored in the computer list is based. For n-ary tree, because the degree of each node is not the same, it must be set aside to store the n link field maximum storage space for each node.
      This particular n-tree waste of storage space link. Suppose there are n m-ary tree nodes, then the total n * m tree links fields. Thus, in addition to the roots, each non-empty connection point to a node, so that the number of air links to n * m - (m-1 ) = m * (n-1) + 1, and n-tree waste link rate [m * (n-1) +1] / m * n. So get what conclusion:
      the n-2 =, binary tree waste link rate of about 1/2.
      when n = 3, the link ternary tree waste rate of about 2/3.
      When 4 n =, linked quadtree waste rate of about 3/4.
      ... ...
      when n = 2, the lowest rate of waste, so in order to improve the shortcomings of wasted storage space, the most commonly used binary tree.
    • Binary - Binary Tree / Knuth tree
      binary tree with the general difference:
      1. The tree is not empty set, but can be a binary tree
      2. Tree of degree d≥0, but the degree of node binary tree is 0 ≤ d ≤ 2
      3. There is no relationship between the order of the sub-tree, binary tree there
  • Graph structure
    among the tree structure representing node "hierarchical" relationship
    graph structure between two vertices discussed "whether communication"
    weighted graph - "network"
    • Euler ring (Eulerian Cycle): When all degrees of vertices are even order from a vertex, once through each edge, then back to the starting point.
    • Even zipper (Eularian Chain): From a peak, after each edge once, not necessarily back to the beginning, which only allows two vertices of odd degree, the rest must all be even.
    • Directed graph (V1, V2)
    • Undirected graph <V1, V2>
  • Hash table
    • bucket (bucket): the position data stored in the hash table, each position corresponding to a unique address (bucket address), the tub like a record.
    • slot (slot): Each record may contain several fields, and slot refers to the bucket field.
    • Collision (collision): two different data, after the Hash function corresponding to the same address.
    • Overflow: the operation data corresponding to the bucket is full.
    • Hash: contiguous memory to store records. A similar index table data table, can be divided into n bucket, each bucket can be divided into the n-th slot.
    • Synonym (Synonym): two identifiers I1 and I2 after the hash function value obtained by the same operation, i.e., f (I1) = f (I2), I1 and I2 is said for the hash function f are synonymous.
    • Loading density (Loading Factor): the number of identifiers using a hash table divided by the total number of the groove
      [alpha] (loading density) = n (the number of identifiers used) / [s (the number of slots per barrel) * b ( the number of buckets)]
      the larger the value of α, the higher the usage of the hash space, the collision probability of overflow or higher.
    • Perfect hash (Perfect Hashing): no collision and overflow hash function generator.
    • in principle:
      1. Reduce collisions and removal
      2. Hash function should not be too complicated, the easier the better computing
      3. Try to convert the text into a digital key key to facilitate the calculation
      4. Calculated hash function value obtained by design, uniform distribution of each bucket

Guess you like

Origin www.cnblogs.com/catyuang/p/11506264.html