You are on page 1of 6

21:30, 16/12/2021 AVL: Attempt review

Trang của tôi


/
Khoá học
/
Học kỳ I năm học 2021-2022 (Semester 1 - Academic year 2021-2022)

/
Đạ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

Đã bắt đầu vào Wednesday, 15 December 2021, 11:19 AM


lúc
Tình trạng Đã hoàn thành
Hoàn thành vào Wednesday, 15 December 2021, 1:14 PM
lúc
Thời gian thực 1 giờ 55 phút
hiện
Điểm 10,00 của 10,00 (100%)

Câu hỏi 1

Hoàn thành

Điểm 1,00 của 1,00

After re-balance at the root, the tree 14 (12 20 (18 23 (- 44))), where as - means NULL, will be ______ .

a. 23 (20 (14 (12 18) -) 44)

b. 18 (14 (12 -) 23 (20 44))

c. 20 (14 (2 18) 23 (- 44))


d. 14 (12 20 (18 23 (- 44)))

Câu hỏi 2

Hoàn thành

Điểm 1,00 của 1,00

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)))

c. 18 (12 (8 (4 -) 14) 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

Điểm 1,00 của 1,00

After re-balance at the root, the tree 18 (12 44 (23 (20 -) 52)), where as - means NULL, will be ______ .

a. 18 (12 44 (23 (20 -) 52))

b. 18 (2 (- 20 (- 23)) 44 (- 52))

c. 23 (18 (2 20) 44 (- 52))

d. 23 (2 (- 20 (18 -)) 44 (- 52))

Câu hỏi 4

Hoàn thành

Điểm 1,00 của 1,00

After re-balance at the root, the tree 20 (18 (12 19) -), where as - means NULL, will be ______ .

a. 20 (18 (12 19) -)

b. 19 (12 (- 18) 20)

c. 19 (18 (12 -) 20)

d. 18 (12 20 (19 -))

Câu hỏi 5

Hoàn thành

Điểm 1,00 của 1,00

After re-balance at the root, the tree 23 (18 (12 (4 14 (- 16)) 20) 44 (- 52)), where as - means NULL, will be ______ .

a. 23 (12 (4 14) 18 (16 20)) 44 (- 52))

b. 23 (14 (12 (4 -) 18 (16 20)) 44 (- 52))

c. 23 (14 (12 (4 -) 16 (- 20 (18 -))) 44 (- 52))

d. 23 (18 (12 (4 14 (- 16)) 20) 44 (- 52))

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

Điểm 1,00 của 1,00

AVL Deletion?

a. if (root is null) {

  shorter = false;

  success = false;

  return null;

if (deleteKey < root -> data -> key) {

  AVLDelete(root -> left, deleteKey, shorter, success);

  if (shorter) {

    root = deleteRightBalance(root, shorter);

  }

} else {

  if (deleteKey > root -> data -> key) {

    AVLDelete(root -> right, deleteKey, shorter, success);

    if (shorter) {

      root = deleteRightBalance(root, shorter);

    }

  } else {

    ...

  }

b. if (root is null) {

  shorter = false;

  success = false;

  return null;

if (deleteKey > root -> data -> key) {

  AVLDelete(root -> left, deleteKey, shorter, success);

} else {

  if (deleteKey > root -> data -> key) {

    AVLDelete(root -> right, deleteKey, shorter, success);

  } else {

    ...

  }

c. if (root is null) {
  shorter = false;

  success = false;

  return null;

if (deleteKey < root -> data -> key) {

  AVLDelete(root -> left, deleteKey, shorter, success);

} else {

  AVLDelete(root -> right, deleteKey, shorter, success);

d. if (root is null) {

  shorter = false;

  success = false;

  return null;

if (deleteKey > root -> data -> key) {

  AVLDelete(root -> left, deleteKey, shorter, success);

  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

    root = deleteRightBalance(root, shorter);

  }

} else {

  if (deleteKey > root -> data -> key) {

    AVLDelete(root -> right, deleteKey, shorter, success);

    if (shorter) {

      root = deleteRightBalance(root, 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

Điểm 1,00 của 1,00

AVL Insertion?

a. if (root is null) {

  root = newPtr;

  taller = true;

  return root;

if (newPtr -> data -> key < root -> data -> key) {

  AVLInsert(root -> left, newPtr, taller);

  leftBalance_ifneed(root, taller);

} else {

  AVLInsert(root -> right, newPtr, taller);

  rightBalance_ifneed(root, taller);

b. if (root is null) {

  root = newPtr;

  taller = true;

  return root;

if (newPtr -> data -> key < root -> data -> key) {

  AVLInsert(root -> left, newPtr, taller);

} else {

  AVLInsert(root -> right, newPtr, taller);

c. if (root is null) {
  root = newPtr;

  taller = true;

  return root;

if (newPtr -> data -> key > root -> data -> key) {

  AVLInsert(root -> left, newPtr, taller);

  leftBalance_ifneed(root, taller);

} else {

  AVLInsert(root -> right, newPtr, taller);

  rightBalance_ifneed(root, taller);

d. if (root is null) {

  root = newPtr;

if (newPtr -> data -> key < root -> data -> key) {

  AVLInsert(root -> left, newPtr, taller);

} else {

  AVLInsert(root -> right, newPtr, taller);

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

Điểm 1,00 của 1,00


Phát triển dựa trên hệ thống Moodle

AVL tree?

a. Ensure that the complexity of search is O(log2 n).

b. All of the other answers.

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

Điểm 1,00 của 1,00

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

Điểm 1,00 của 1,00

When to re-balance an AVL tree?

a. Print out a tree that make the tree un-balance.

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.

d. Search a value of a 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

You might also like