数据结构与算法 AVL查找树

1-1
The inorder traversal sequence of an AVL tree must be in sorted (non-decreasing) order. T
AVL 树的中序遍历序列必须是有序(非递减)顺序
1-3
An AVL tree with the balance factors of all the non-leaf nodes being 0 must be a perfect binary tree. T
所有非叶子节点的平衡因子都为0的AVL树必须是完全二叉树
1-4
For an AVL tree, the balance factors of all the non-leaf nodes are 0 iff the tree is a complete binary tree. F
对于一棵 AVL 树,当该树是完全二叉树时,所有非叶节点的平衡因子为 0
1-10
非空的平衡二叉树中插入一个结点,原有结点中至少一个结点的平衡因子会改变。 T
2-3
Insert 2, 1, 4, 5, 9, 3, 6, 7 into an initially empty AVL tree. Which one of the following statements is FALSE? B
A.4 is the root
B.3 and 7 are siblings
C.2 and 6 are siblings
D.9 is the parent of 7
插入9时RR旋转,插入3时RL旋转(注意此时3是2的右孩子),插入6时RL旋转,
2-4
如果AVL树的深度为5(空树的深度定义为0),则此树最少有多少个结点? A
A.12
B.20
C.33
D.64
设 n(h) 是高度为h的平衡二叉树的最小结点数.
n(h) = n(h-1) + n(h-2) + 1,n(1)=1,n(2)=2;
2-6
For an AVL-tree of height 4, what is the minimum number of the tree nodes? (the height of one node tree is 0) B
A.11
B.12
C.14
D.15
2-5
将 7, 8, 9, 2, 3, 5, 6, 4 顺序插入一棵初始为空的AVL树。下列句子中哪句是错的? D
A.7 是根结点
B.2 和 5 是兄弟
C.有2个结点的平衡因子为-1
D.3 是 4 的父结点
插入9时RR旋转,插入3时LR旋转,插入5时LR旋转(注意L旋转之后5是3的右孩子)
2-12
Delete a node v from an AVL tree T 1, we can obtain another AVL tree T 2. Then insert v into T2, we can obtain another AVL tree T3. Which one(s) of the following statements about T1 and T3 is(are) true? A
I、If v is a leaf node in T1, then T1 and T3 might be different.
II、If v is not a leaf node in T1, then T1 and T3 must be different.
III、If v is not a leaf node in T1, then T1 and T3 must be the same.
A.I only
B.II only
C.I and II only
D.I and III only
2-15
If there are 14 nodes in an AVL tree, then the maximum depth of the tree is ____. The depth of an empty tree is defined to be 0. C
A.3
B.4
C.5
D.6
给定结点数为 n的AVL树的
最大高度为O(log2n)
2-16
If there are 28 nodes in an AVL tree, then the maximum depth of the tree is ____. The depth of an empty tree is defined to be -1. C
A.3
B.4
C.5
D.6

  • 0
    点赞
  • 4
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值