Written in the front: according to the focus of the Han Hao painting, at this stage, the tree, map to understand the logical structure, storage mode, not required code implementation. 6th Chapter Two fork trees and trees 6.1 Two fork tree: concept and nature 6.1.1 Concept and Nature Definitions and diagrams several basic concepts
The number of sub nodes of a node is called the degree of the node.
In a binary tree, there are two subtrees of nodes that are empty and have no child nodes . This node is called a leaf (node). The path, the node's layer and the height of the tree the properties of the two-forked tree full two fork tree, expand two fork tree complete two-fork tree
6.1.2 Abstract Data type 6.1.3 traversing the binary tree
Depth First traversal
(Reader: This section of the first, middle and posterior root sequence traversal , a bit difficult to understand, suggest careful reading.) )
Width First traversal Traversal and search
(Reader: This section is not carefully read.) 6.2 Two fork Tree list implementation 6.2.1 design and implementation of the 6.2.22 Fork Tree Simple application: expression tree Two-element expression and two-tree constructed expression expression evaluation /c7> extension 6.2.32 Fork Tree Simple application: expression tree 6.3 Precedence Queue
An important caching structure : precedence Queues . 6.3.1 Concept
implementation of 6.3.2 based on linear table Considerations for implementing Methods priority queues based on list implementation The Analysis of continuous table implementation 6.3.3 tree-shaped structure and heap linear and tree-shaped structures Heap and its properties heap and Precedence queue heap implementation of 6.3.4 precedence queues inserting elements and filtering up popup element and down filter Heap-based priority queue classes complexity of build operations Application of 6.3.5 heap: Heap sorting 6.4 Applications: Discrete event Simulations 6.4.1 General simulation Framework 6.4.2 Customs Checkpoint simulation system Analog Class event class Actual Simulation class implementation of 6.5 two fork tree 6.5.12-Fork Tree class implementation 6.5.2 Traversal Algorithm recursive-defined traversal functions Width First traversal the first-order traversal function of non-recursive roots traversing through the generator function non-recursive posterior root sequence traversal algorithm non-recursive traversal 6.5.32 Fork Tree Class 6.6 Huffman Tree 6.6.1 Haffman Algorithm Huffman Tree the algorithm of constructing Huffman tree implementation of 6.6.2 Huffman algorithm 6.6.3 Huffman Coding 6.7 Trees and Woods 6.7.1 Examples and representations 6.7.2 Definitions and related concepts 6.7.3 Abstract data types and operations The realization of 6.7.4 tree the Python implementation of the 6.7.5 tree Summary of this chapter Practice
Reference documents:
1. "Data structure and algorithm-python language description".