發現國内好多教材對樹的解釋含含糊糊,找了下英文原版,理解就沒那麼費勁了
結點的level:The level of a node is defined by 0 (the number of connections between the node and the root).
結點的高度(Height):The height of a node is the number of edges on the longest path between that node and a leaf.
樹的高度:The height of a tree is the height of its root node.
結點的深度(Depth of node):The depth of a node is the number of edges from the tree's root node to the node.
結點的度(Degree):The number of sub trees of a node.
葉子(Leaf):A node with no children.
二叉樹的性質:
(1)若二叉樹的層次從0開始,則在二叉樹的第i層至多有2^i個結點(i>=0)。
(2)高度為k的二叉樹最多有2^(k 1) - 1個結點(k>=-1)。 (空樹的高度為-1)
(3)對任何一棵二叉樹,如果其葉子結點(度為0)數為m, 度為2的結點數為n, 則m = n 1。
完美二叉樹(Perfect Binary Tree)
完全二叉樹(Complete Binary Tree)
A Complete Binary Tree (CBT) is a binary tree in which every level, except possibly the last, is completely filled, and all nodes are as far left as possible.
完滿二叉樹(Full Binary Tree)
,
更多精彩资讯请关注tft每日頭條,我们将持续为您更新最新资讯!