A tree is defined as a ______.
A. Directed graph
B. Connected acyclic graph
C. Balanced graph
D. Weighted acyclic graph
B. Connected acyclic graph
In a rooted tree, the number of children a node has is its ____.
A. Height
B. Level
C. Degree
D. Depth
C. Degree
Which traversal visits nodes in the order: Left, Visit, Right?
A. Preorder
B. Inorder
C. Postorder
D. Breadth-first
B. Inorder
All internal nodes have exactly two children in a ______ binary tree.
A. Complete
B. Perfect
C. Full
D. Balanced
C. Full
Which operation moves a newly inserted heap element upward?
A. bubbleDown
B. heapifyDown
C. heapifyUp
D. rotateRight
C. heapifyUp
The height of a tree is defined as:
A. Maximum depth of any node
B. Number of children of the root
C. Distance between two siblings
D. Depth of the root
A. Maximum depth of any node
In a complete binary tree, nodes at the last level are filled from ______.
A. Right to left
B. Random order
C. Center outward
D. Left to right
D. Left to right
In a BST, where is the smallest element located?
A. Rightmost node
B. Leftmost node
C. Root always
D. Any leaf
B. Leftmost node
An AVL tree maintains balance if the height difference between left and right subtree is at most:
A. 0
B. 1
C. 2
D. 3
B. 1
Deleting a BST node with two children requires replacing it with:
A. Any leaf
B. In-order successor or predecessor
C. The root
D. Its sibling
B. In-order successor or predecessor
A max-heap must always satisfy the:
A. Height rule only
B. Structural property only
C. Heap-order property only
D. Structural AND heap-order property
D. Structural AND heap-order property
Which set representation uses a sequence of bits to indicate membership?
A. Hashing
B. Bit-string
C. Linked list
D. Tree set
B. Bit-string
The path between any two nodes in a tree is always ______.
unique
A tree with no nodes is called an ______ tree.
empty
The number of edges in a tree with n nodes is ______.
⌊i / 2⌋
In the array representation of a binary heap, the parent of node at index i is at index ______.
0
An AVL imbalance that occurs when inserting into the right subtree of the left child is called the ______ case.
RL (Right-Left case)
In the First-Child / Next-Sibling representation, each node has two pointers: ______ and ______.
firstChild and nextSibling
A BST search stops when a null child is reached, meaning the element is ______.
null
Heap sort using a max-heap produces the final array in ______ order.
ascending
A forest is defined as:
A. A tree with no root
B. A tree with many roots
C. A collection of disjoint trees
D. A tree with cycles
C. A collection of disjoint trees
The depth of a node is the length of the path from the ______.
A. Node to any leaf
B. Node to its parent
C. Root to the node
D. Node to its sibling
C. Root to the node
Which representation requires k pointers per node?
A. First-child / next-sibling
B. k-ary tree representation
C. Parent-pointer only
D. Array representation
B. k-ary tree representation
In an almost complete binary tree, missing nodes appear only on the ______.
A. Left side
B. Right side
C. Root
D. Middle
B. Right side