Professional Documents
Culture Documents
AVL - Attempt Review
AVL - Attempt Review
/
Đại Học Chính Qui (Bacherlor program (Full-time study))
/
Khoa Khoa học và Kỹ thuật Máy tính (Faculty of Computer Science and Engineering )
/
Khoa Học Máy Tính
/
Cấu trúc dữ liệu và giải thuật (CO2003)_Vương Bá Thịnh (DH_HK211)
/ Quiz 2
/
AVL
Câu hỏi 1
Hoàn thành
After re-balance at the root, the tree 14 (12 20 (18 23 (- 44))), where as - means NULL, will be ______ .
Câu hỏi 2
Hoàn thành
After re-balance at the root, the tree 18 (12 (8 (4 -) 14) 20), where as - means NULL, will be ______ .
a. 12 (8 (4 -) 18 (14 20))
b. 12 (8 (4 -) 14 (- 18 (- 20)))
d. 14 (8 (4 12) 18 (- 20))
e-learning.hcmut.edu.vn/mod/quiz/review.php?attempt=4631135&cmid=735343 1/6
21:30, 16/12/2021 AVL: Attempt review
Câu hỏi 3
Hoàn thành
After re-balance at the root, the tree 18 (12 44 (23 (20 -) 52)), where as - means NULL, will be ______ .
b. 18 (2 (- 20 (- 23)) 44 (- 52))
Câu hỏi 4
Hoàn thành
After re-balance at the root, the tree 20 (18 (12 19) -), where as - means NULL, will be ______ .
Câu hỏi 5
Hoàn thành
After re-balance at the root, the tree 23 (18 (12 (4 14 (- 16)) 20) 44 (- 52)), where as - means NULL, will be ______ .
e-learning.hcmut.edu.vn/mod/quiz/review.php?attempt=4631135&cmid=735343 2/6
21:30, 16/12/2021 AVL: Attempt review
Câu hỏi 6
Hoàn thành
AVL Deletion?
a. if (root is null) {
shorter = false;
success = false;
return null;
if (shorter) {
}
} else {
if (shorter) {
}
} else {
...
}
b. if (root is null) {
shorter = false;
success = false;
return null;
} else {
} else {
...
}
c. if (root is null) {
shorter = false;
success = false;
return null;
} else {
d. if (root is null) {
shorter = false;
success = false;
return null;
if (shorter) {
e-learning.hcmut.edu.vn/mod/quiz/review.php?attempt=4631135&cmid=735343 3/6
21:30, 16/12/2021 AVL: Attempt review
}
} else {
if (shorter) {
}
} else {
...
}
e-learning.hcmut.edu.vn/mod/quiz/review.php?attempt=4631135&cmid=735343 4/6
21:30, 16/12/2021 AVL: Attempt review
Câu hỏi 7
Hoàn thành
AVL Insertion?
a. if (root is null) {
root = newPtr;
taller = true;
return root;
if (newPtr -> data -> key < root -> data -> key) {
leftBalance_ifneed(root, taller);
} else {
rightBalance_ifneed(root, taller);
b. if (root is null) {
root = newPtr;
taller = true;
return root;
if (newPtr -> data -> key < root -> data -> key) {
} else {
c. if (root is null) {
root = newPtr;
taller = true;
return root;
if (newPtr -> data -> key > root -> data -> key) {
leftBalance_ifneed(root, taller);
} else {
rightBalance_ifneed(root, taller);
d. if (root is null) {
root = newPtr;
if (newPtr -> data -> key < root -> data -> key) {
} else {
e-learning.hcmut.edu.vn/mod/quiz/review.php?attempt=4631135&cmid=735343 5/6
21:30, 16/12/2021 AVL: Attempt review
Câu hỏi 8 Copyright 2007-2021 Trường Đại Học Bách Khoa - ĐHQG Tp.HCM. All Rights Reserved.
Hoàn thành
Địa chỉ: Nhà A1- 268 Lý Thường Kiệt, Phường 14, Quận 10, Tp.HCM.
Email: elearning@hcmut.edu.vn
AVL tree?
c. A balanced BST.
d. A BST, in which the heights of the left and right subtrees of the root differ by at most 1, and the left and right subtrees are again AVL
trees.
Câu hỏi 9
Hoàn thành
In the worst case, the complexity of searching a value in an AVL tree of n nodes is ____ .
a. O(nlog2 n).
b. O(1).
c. O(log2 n).
d. O(n) .
Câu hỏi 10
Hoàn thành
b. Insert to or delete from the tree always make the tree un-balance.
c. Insert to or delete from the tree that make the tree un-balance.
◄ Sắp xếp
Chuyển tới...
B-tree ►
e-learning.hcmut.edu.vn/mod/quiz/review.php?attempt=4631135&cmid=735343 6/6