数据库树算法(数据结构-树)

发现国内好多教材对树的解释含含糊糊,找了下英文原版,理解就没那么费劲了

结点的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)

数据库树算法(数据结构-树)(1)

完全二叉树(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.

数据库树算法(数据结构-树)(2)

完满二叉树(Full Binary Tree)

数据库树算法(数据结构-树)(3)

数据库树算法(数据结构-树)(4)

,

免责声明:本文仅代表文章作者的个人观点,与本站无关。其原创性、真实性以及文中陈述文字和内容未经本站证实,对本文以及其中全部或者部分内容文字的真实性、完整性和原创性本站不作任何保证或承诺,请读者仅作参考,并自行核实相关内容。文章投诉邮箱:anhduc.ph@yahoo.com

    分享
    投诉
    首页