1. An array of Complete Binary Trees indicates 1. use an array to represent A Complete Binary Tree: store data from the root node, store the data in 0th locations as A, 1st and 2nd locations respectively, and store the L and G, respectively, from the left. 650) this. width = 650; "src =" http://www.bkjia.com/uploads/allimg/131228/14255R949-0.png "title =" Image.png "alt =" 162730493.png"/> 2. the reason for the convenience of Array Storage 1) the root node always appears at the position of array 0. 2) assuming that the position of a non-root node is in the I position of the array, its parent is always in the i-1)/2 position. For example, I = 3, the data is O, (3-1)/2 = 1, the location of the parent in the array is 1, and the data is L. 3) assume that the position of the data of a node in the array is I, then its child always appears in the following two locations left child at: 2 * I + 1 right child: 2 * I + 2 2. the node class of the Complete Binary Tree represents 1. each node of a binary tree can be considered as an object storage of a binary tree node class. The Node class contains private instance variables referenced to other nodes in the book. A complete tree represents a reference to the root node. 2. One Binary Tree: each node contains a private variable to store data and points to two references of its own left child and right child. Class BTNode <E> {private E data; private BTNode <E> left; private BTNode <E> right;...} 3. indicates the character binary tree, And the diagonal line indicates no reference. 650) this. width = 650; "src =" http://www.bkjia.com/uploads/allimg/131228/14255V633-1.png "title =" Image.png "alt =" 162833996.png"/>
There is no such thing as a great talent without great will-power. -- Balzac
Without great willpower, there will be no great talents. -- Balzac