Some 11.2 using tree (Applications of Trees)

Some 11.2 using tree (Applications of Trees)

Binary search tree (Binary Search Trees)

Binary search tree, the predetermined data is stored in the node, and a predetermined right child of the key is greater than the parent, left child key is smaller than the parent node (if present)

In general, the binary search tree search, insert (must be inserted the leaf nodes) removed and the time complexity is O (log_n), but that would increase the complexity of O (n), should be selected at this time balanced binary tree to resolve (AVL tree of deteriorating the linear list, red and black trees, etc.)

Decision tree (Decision Trees)

Root: decision tree having a binary tree data structure inside, all the attributes of the tree
test conditions non-leaf nodes :( decision points) represents the test data attributes
leaf node: obtaining the classification class label
branches: the test results

Optimal tree (Huffman)



Two yuan prefix code



Proof: the left branch is 0, the right branch is 1, a binary tree structure may be bound to a unique binary prefix code

Application: use of Huffman prefix code and binary coding tree, in the communication transmission, using different frequency letters (converted to right) for encoding the Huffman tree appear to give two yuan according to the Huffman prefix code, in such a communication transmission efficiency maximization

Game tree

Similar to the tree?

Guess you like

Origin www.cnblogs.com/SpicyArticle/p/12150572.html