Site icon T4Tutorials.com

AVL Trees MCQs

1. : What is an AVL tree?

(A) A tree where each node has at most two children


(B) A self-balancing binary search tree with a balance factor


(C) A tree where the left subtree is greater than the root and the right subtree is less than the root


(D) A tree where the left subtree is less than the root and the right subtree is greater than the root



2. : In an AVL tree, what is the maximum allowed height difference (balance factor) between the left and right subtrees of any node?

(A) 0


(B) 1


(C) 2


(D) 3



3. : What is the worst-case time complexity for searching an element in an AVL tree with n nodes?

(A) O(1)


(B) O(log n)


(C) O(n)


(D) O(n log n)



4. : Which operation in an AVL tree may require tree rotations to maintain balance?

(A) Insertion


(B) Deletion


(C) Searching


(D) Traversal



5. : In an AVL tree, which rotation is used to restore balance when the tree becomes right-heavy?

(A) Left rotation


(B) Right rotation


(C) Double left rotation


(D) Double right rotation



6. : Which of the following properties is NOT necessarily true for AVL trees?

(A) Binary search property


(B) Balanced height


(C) Complete binary structure


(D) Symmetric nodes



7. : What is the time complexity of inserting an element into an AVL tree?

(A) O(1)


(B) O(log n)


(C) O(n)


(D) O(n log n)



8. : Which traversal of an AVL tree visits nodes in non-decreasing order of their values?

(A) Preorder


(B) Inorder


(C) Postorder


(D) Level order



9. : In an AVL tree, which operation is used to find the successor of a given node?

(A) findSuccessor()


(B) successor()


(C) next()


(D) nextNode()



10. : Which rotation operation is used in AVL trees to restore balance after a double rotation is performed?

(A) Left rotation


(B) Right rotation


(C) Double left rotation


(D) Double right rotation



11. : What is the worst-case time complexity for deleting an element from an AVL tree?

(A) O(1)


(B) O(log n)


(C) O(n)


(D) O(n log n)



12. : In an AVL tree, what is the minimum number of nodes at level k?

(A) 2^k


(B) k


(C) k+1


(D) k-1



13. : Which traversal of an AVL tree starts from the root, visits the left subtree, and then visits the right subtree?

(A) Preorder


(B) Inorder


(C) Postorder


(D) Level order



14. : In an AVL tree, what is the maximum number of edges in a path from the root to a leaf node?

(A) log n


(B) n


(C) n


(D) n-1



15. : Which rotation operation is used in AVL trees to restore balance after a double left rotation is performed?

(A) Left rotation


(B) Right rotation


(C) Double left rotation


(D) Double right rotation



16. : Which traversal of an AVL tree visits nodes in descending order of their values?

(A) Preorder


(B) Inorder


(C) Postorder


(D) Reverse Inorder



17. : In an AVL tree, what is the maximum number of nodes at height h?

(A) 2^h


(B) 2^(h+1) – 1


(C) h^2


(D) h



18. : Which traversal of an AVL tree visits nodes level by level?

(A) Preorder


(B) Inorder


(C) Postorder


(D) Level order



19. : Which of the following statements is true about AVL trees?

(A) They are always perfectly balanced.


(B) They require no rotations to maintain balance.


(C) They guarantee O(1) time complexity for all operations.


(D) They maintain a balance factor to ensure heights remain balanced.



 

 

Data Structures MCQs

Basic Concepts

  1. Introduction to Data Structures
  2. Complexity Analysis MCQs

Linear Data Structures MCQs

  1. Arrays MCQs
  2. Linked Lists MCQs
  3. Stacks MCQs
  4. Queues MCQs

Non-Linear Data Structures MCQs

  1. Trees MCQs
  2. Heaps MCQs
  3. Graphs MCQs

Hashing MCQs MCQs

  1. Hash Tables

Sorting and Searching Algorithms MCQs 

  1. Sorting Algorithms MCQs
  2. Searching Algorithms MCQs

Miscellaneous

  1. Memory Management in data structures MCQs
  2. String Manipulation Algorithms MCQs
  1. Data Structures MCQs 1
  2. Data Structures MCQs 2
  3. Data Structures MCQs 3
  4. Data Structures MCQs 4
  5. Data Structures MCQs 5
  6. Stacks Solved MCQs
  7. Queues MCQs
  8. pointer mcqs
  9. Array MCQs

 

Exit mobile version