21
In a binary tree, what is the term used to describe a node with no parent?
A)
Root
B)
Leaf
C)
Child
D)
Sibling
Answer & Solution
Answer: Option
A
22
What property distinguishes a binary tree from a general tree?
A)
Each node in a binary tree has at most two children, whereas in a general tree, nodes can have more than two children.
B)
Binary trees are balanced, while general trees are not.
C)
Binary trees only have one level, while general trees have multiple levels.
D)
Binary trees have a fixed height, while general trees have a variable height.
Answer & Solution
Answer: Option
A
23
Which traversal method is typically used for creating a mirrored image of a binary tree?
A)
Postorder
B)
Inorder
C)
Preorder
D)
Level-order
Answer & Solution
Answer: Option
C
24
What is the time complexity of inserting an element into an AVL tree in the worst case?
A)
O(1)
B)
O(log n)
C)
O(n)
D)
O(n log n)
Answer & Solution
Answer: Option
B
25
How does a Splay Tree ensure that recently accessed elements are quick to access again?
A)
By performing rotations to move accessed nodes to the root
B)
By balancing the tree after each operation
C)
By using a self-balancing mechanism
D)
By storing elements in a sorted manner
Answer & Solution
Answer: Option
A
26
In a B-Tree, what is the significance of the "order" of the tree?
A)
It determines the maximum number of children each node can have
B)
It determines the minimum height of the tree
C)
It determines the number of levels in the tree
D)
It determines the maximum number of levels
Answer & Solution
Answer: Option
A
27
What is a common use case for a Trie data structure?
A)
Storing a dictionary for fast prefix-based searches
B)
Performing binary search operations
C)
Implementing balanced search trees
D)
Storing hierarchical data
Answer & Solution
Answer: Option
A
28
In a Red-Black Tree, what does the property that "every path from a node to its descendant leaves has the same number of black nodes" ensure?
A)
It ensures the tree remains balanced
B)
It ensures nodes are always red
C)
It ensures the tree is full
D)
It ensures the tree is complete
Answer & Solution
Answer: Option
A
29
What is the maximum number of nodes at level L of a binary tree?
A)
2L
B)
2(L+1)
C)
2(L-1)
D)
2(L+2)
Answer & Solution
Answer: Option
A
30
What is the key difference between a binary heap and a binary search tree?
A)
A binary heap maintains a heap property and is typically used to implement priority queues, while a binary search tree maintains sorted order of elements.
B)
A binary heap is a type of balanced tree, while a binary search tree is an unbalanced tree.
C)
A binary heap stores elements in sorted order, while a binary search tree does not.
D)
A binary heap supports fast insertion and deletion, while a binary search tree supports fast search.
Answer & Solution
Answer: Option
A