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
Answer: b) A self-balancing binary search tree with a balance factor
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
Answer: b) 1
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)
Answer: b) O(log n)
Which operation in an AVL tree may require tree rotations to maintain balance?
a) Insertion
b) Deletion
c) Searching
d) Traversal
Answer: a) Insertion
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
Answer: a) Left rotation
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
Answer: c) Complete binary structure
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)
Answer: b) O(log n)
Which traversal of an AVL tree visits nodes in non-decreasing order of their values?
a) Preorder
b) Inorder
c) Postorder
d) Level order
Answer: b) Inorder
In an AVL tree, which operation is used to find the successor of a given node?
a) findSuccessor()
b) successor()
c) next()
d) nextNode()
Answer: b) successor()
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
Answer: b) Right rotation
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)
Answer: b) O(log n)
In an AVL tree, what is the minimum number of nodes at level
π
k?
a)
2
π
2
k
b)
π
k
c)
π
+
1
k+1
d)
π
β
1
kβ1
Answer: a)
2
π
2
k
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
Answer: a) Preorder
In an AVL tree, what is the maximum number of edges in a path from the root to a leaf node?
a)
log
β‘
π
logn
b)
π
n
c)
π
n
β
d)
π
β
1
nβ1
Answer: d)
π
β
1
nβ1
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
Answer: d) Double right rotation
Which traversal of an AVL tree visits nodes in descending order of their values?
a) Preorder
b) Inorder
c) Postorder
d) Reverse Inorder
Answer: d) Reverse Inorder
In an AVL tree, what is the maximum number of nodes at height
β
h?
a)
2
β
2
h
b)
2
β
+
1
β
1
2
h+1
β1
c)
β
2
h
2
d)
β
h
Answer: a)
2
β
2
h
Which traversal of an AVL tree visits nodes level by level?
a) Preorder
b) Inorder
c) Postorder
d) Level order
Answer: d) Level order
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.
Answer: d) They maintain a balance factor to ensure heights remain balanced
Basic Concepts
Non-Linear Data Structures MCQs
Sorting and Searching Algorithms MCQsΒ
- Data Structures MCQs 1
- Data Structures MCQs 2
- Data Structures MCQs 3
- Data Structures MCQs 4
- Data Structures MCQs 5
- Stacks Solved MCQs
- Queues MCQs
- pointer mcqs
- Array MCQs