What is the primary property of an AVL tree?
A. It allows duplicate keys.
B. It is a self-balancing binary search tree.
C. It maintains a fixed height.
D. It allows duplicate keys.
Select an option to see the answer and solution.
Which of the following operations is used to restore balance in an AVL tree after insertion?
A. Merging
B. Splaying
C. Rotations
D. Hashing
Select an option to see the answer and solution.
In a Red-Black tree, which property ensures that no two consecutive red nodes exist on any path?
A. Black property
B. Balance property
C. Height property
D. Red property
Select an option to see the answer and solution.
What is the maximum height of an AVL tree with n nodes?
A. log2 (n + 1)
B. log2 (n)
C. 2*log2 (n)
D. log10 (n)
Select an option to see the answer and solution.
Which tree property is used to ensure that in a B-Tree all leaves are at the same level?
A. B-Tree order
B. Equal key distribution
C. Balanced height
D. Uniform height
Select an option to see the answer and solution.
In a Red-Black tree, what is the color of the root node?
A. Red
B. Can be either
C. Black
D. It varies based on height
Select an option to see the answer and solution.
What is the order of a B-Tree if it has a maximum of m children per node?
Select an option to see the answer and solution.
What is the time complexity of insertion in an AVL tree?
A. O(1)
B. O(log2 n)
C. O(log n)
D. O(n)
Select an option to see the answer and solution.
In a Red-Black tree, which property helps in maintaining a balanced tree?
A. The AVL property
B. The B-Tree property
C. The splay property
D. The red-black property
Select an option to see the answer and solution.
What is the primary difference between a Red-Black tree and an AVL tree?
A. AVL trees are more rigidly balanced.
B. Red-Black trees have stricter balancing.
C. AVL trees use color-coding.
D. Red-Black trees do not require rotations.
Select an option to see the answer and solution.
What is the maximum number of children a node in a B-Tree of order m can have?
Select an option to see the answer and solution.
Which operation in a B-Tree involves redistributing keys between nodes to maintain balance?
A. Splitting
B. Rotating
C. Merging
D. Splaying
Select an option to see the answer and solution.
In an AVL tree, what type of rotation is performed when a node has a balance factor of +2 and its right child has a balance factor of -1?
A. Left Rotation
B. Left-Right Rotation
C. Right Rotation
D. Left Rotation
Select an option to see the answer and solution.
In a Red-Black tree, what does the black-height of a node represent?
A. The height of the node's subtree.
B. The total number of nodes in the subtree.
C. The number of black nodes on the path from that node to a leaf.
D. The number of red nodes on the path.
Select an option to see the answer and solution.
What is the time complexity of searching for an element in a B-Tree of order m?
A. O(log n)
B. O(n)
C. O(1)
D. O(log_m n)
Select an option to see the answer and solution.
Which type of rotation is performed to fix a right-right case imbalance in an AVL tree?
A. Left Rotation
B. Right Rotation
C. Left-Right Rotation
D. Right-Left Rotation
Select an option to see the answer and solution.
In a Red-Black tree, which property is used to ensure that the path from the root to the farthest leaf is no more than twice as long as the path to the nearest leaf?
A. Height property
B. Balance property
C. Red property
D. Black-height property
Select an option to see the answer and solution.
What is the maximum number of children a non-root node can have in a B-Tree of order m?
Select an option to see the answer and solution.
In an AVL tree, what happens when a node's balance factor becomes +2 due to an insertion in the right subtree of the right child?
A. A left-right rotation is performed.
B. A single left rotation is performed.
C. A right-left rotation is performed.
D. A left-right rotation is performed.
Select an option to see the answer and solution.
How are keys stored in a B-Tree node?
A. Based on their insertion order
B. Based on their frequency of access
C. In a sorted order
D. In a random order
Select an option to see the answer and solution.