Freshman ninth week learning experience

Binary Search: Also known as a binary search for the good order of the sequence table row.
The basic idea: first lookup given value K, compared with the key element in an intermediate position in the table, if equal, the position of the element is returned; if et al., Showed that only the elements required to find the intermediate the first half or the second half of the element's; then continue with the same look in narrow range, and so forth until you find.
Implementation: recursive and non-recursive
1, a binary search tree
    Features: the values ​​of all the nodes left subtree are equal to or less than the value of the root. Right sub-tree nodes are all values ​​greater than or equal to the value of the root. Left and right subtrees are also binary sort tree.
2、B-tree:
I.e. B-tree tree B tree, B i.e. Balanced, balance means. B- tree is a multi-way search tree (not necessarily binary is) --- balance multi-branch tree
A m-order B-tree has the following characteristics:
    1. The root node has at least two children.
    2. Each intermediate node contains the elements of the k-1 and k children, where m / 2 <= k <= m
    3. Each leaf node contains elements k-1, where m / 2 <= k <= m
    4. All the leaf nodes are in the same layer.
    5. Each node element in ascending order, the nodes of which elements of the k-1 k exactly range of elements contained child partition.
    advantage:
    B tree is a binary tree that is stronger than where the same data, a more chunky B-tree, and a B-tree structure can be achieved self-balancing.
3、B+tree
Overview: B + tree is a tree data structure, n is a binary sort tree, each node typically has a plurality of children, a B + tree comprising a root node, internal nodes and leaf nodes. Root node may be a leaf node, a node may be two or more child nodes contain.
Features:
  1. There are the k th node of the tree contains k intermediate elements (B tree is k-1 elements), each element of data is not saved, the index only used, all data stored in the leaf node.
  2. All the leaf nodes contains information of all the elements, and these elements contain pointers to records, and the leaf node itself according to the size and large keyword brought sequentially linked.
  3. All elements of the intermediate nodes exist in the child node, the maximum (or minimum) in the child element node element.
4, red-black tree
Overview: red-black tree (Red Black Tree) is a self-balancing binary search tree is a data structure used in computer science
Features:
  1. The node is red or black.
  2. The root is black.
  3. Each leaf nodes are black empty node (NIL node).
  4. The two child nodes of each node are black red. (Red can not have two consecutive nodes on all paths from the root to each leaf)
  5. from any node to all leaves of each path contains the same number of black nodes.
5, jump table
Concept: a randomized data structure, based on parallel chain, efficiency comparable to the binary search tree (for most operations require O (log n) time on average), and friendly to concurrent algorithms.
Application: Skip list (jump table) is a balanced tree data structure can replace the default is ascending according to the Key value. Skip list so that the sorted data in a multi-layer distribution list, the random number 0-1 decision whether or not to climb up one of the data, the "space for time" of an algorithm that increases the forward in each node pointer, inserting, deleting, you can ignore some nodes can not be involved when looking to improve efficiency.
 

Guess you like

Origin www.cnblogs.com/vvxvv/p/11441915.html