您的位置:首页 > 其它

Basic knowledge about binary trees

2016-03-29 10:50 316 查看
Difference between complete binary tree and full binary tree:

Actually, full binary tree is a special form of complete binary tree. Complete tree satisfies that all the nodes except the nodes at (h-1) level and h level are fully connected. Full binary tree satisfies that all the nodes expect the nodes at h level are
fully connected. 

满二叉树是完全二叉树的特例,因为满二叉树已经满了,而完全并不代表满。所以形态你也应该想象出来了吧,满指的是出了叶子节点外每个节点都有两个孩子,而完全的含义则是最后一层没有满,并没有满。

What is balanced binary tree?

平衡二叉树(Balanced Binary Tree)又被称为AVL树(有别于AVL算法),且具有以下性质:它是一棵空树或它的左右两个子树的高度差的绝对值不超过1,并且左右两个子树都是一棵平衡二叉树。

There are several commonly saw balanced binary trees like Red-Black Tree and AVL tree.  红黑树(英语:Red–black tree)是一种自平衡二叉查找树,是在计算机科学中用到的一种数据结构,典型的用途是实现关联数组。它是复杂的,但它的操作有着良好的最坏情况运行时间,并且在实践中是高效的:它可以在O(log n)时间内做查找,插入和删除,这里的n是树中元素的数目。

AVL在计算机科学中是最先发明的自平衡二叉查找树。
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: