Data Structures and Algorithms •
MCQ • Trees
Most Important 30 Objective Question - Trees
Q1. Tree is a:
A) Linear data structure
B) Non-linear data structure
C) Sequential structure
D) Static structure
Answer: B
Explanation: Tree is a non-linear data structure where data is organized hierarchically.
Q2. The topmost node of a tree is called:
A) Leaf
B) Root
C) Parent
D) Child
Answer: B
Explanation: The first and topmost node in a tree is called the root node.
Q3. A node with no child is called:
A) Root node
B) Parent node
C) Leaf node
D) Internal node
Answer: C
Explanation: A leaf node is a node that has no children.
Q4. In a binary tree, each node can have at most:
A) 1 child
B) 2 children
C) 3 children
D) Unlimited children
Answer: B
Explanation: A binary tree allows a maximum of two children for each node.
Q5. A Binary Search Tree (BST) follows:
A) Left > Root > Right
B) Left < Root < Right
C) Left = Right
D) Random order
Answer: B
Explanation: In BST, left subtree contains smaller values and right subtree contains larger values.
Q6. AVL tree is a:
A) Balanced Binary Search Tree
B) Circular Tree
C) Graph
D) Heap only
Answer: A
Explanation: AVL tree is a self-balancing binary search tree.
Q7. Which traversal visits Root → Left → Right?
A) Inorder
B) Preorder
C) Postorder
D) Level order
Answer: B
Explanation: Preorder traversal follows Root first, then Left subtree, then Right subtree.
Q8. Which traversal visits Left → Root → Right?
A) Inorder
B) Preorder
C) Postorder
D) Reverse order
Answer: A
Explanation: Inorder traversal visits Left subtree, then Root, then Right subtree.
Q9. Which traversal visits Left → Right → Root?
A) Preorder
B) Inorder
C) Postorder
D) BFS
Answer: C
Explanation: Postorder traversal visits children first and root last.
Q10. Threaded binary tree is used to:
A) Reduce traversal time
B) Increase memory
C) Delete nodes
D) Store graphs
Answer: A
Explanation: Threaded binary tree makes traversal easier without recursion or stack.
Q11. B-Tree is mainly used in:
A) Database indexing
B) Stack implementation
C) Queue operations
D) Linked list traversal
Answer: A
Explanation: B-Tree is commonly used in databases and file systems.
Q12. B+ Tree differs from B-Tree because:
A) Data stored only in leaf nodes
B) No root exists
C) No internal nodes
D) It is a graph
Answer: A
Explanation: In B+ Tree, actual records are stored only in leaf nodes.
Q13. Height of a tree means:
A) Number of nodes
B) Number of edges in longest path from root to leaf
C) Number of leaves
D) Number of roots
Answer: B
Explanation: Height is measured by the longest path from root to deepest leaf.
Q14. Which tree is used for maintaining sorted data dynamically?
A) BST
B) Queue
C) Stack
D) Graph
Answer: A
Explanation: BST supports efficient searching, insertion, and deletion.
Q15. Which is not a tree traversal method?
A) Inorder
B) Preorder
C) Postorder
D) Linear order
Answer: D
Explanation: Linear order is not a standard tree traversal method.
Q16. A node having children is called:
A) Leaf node
B) Parent node
C) Null node
D) Empty node
Answer: B
Explanation: A node with one or more children is called a parent node.
Q17. The nodes below a parent are called:
A) Ancestors
B) Descendants
C) Children
D) Roots
Answer: C
Explanation: Nodes directly connected below a parent are called children.
Q18. Full binary tree means:
A) Every node has 0 or 2 children
B) Every node has 1 child
C) Every node has 3 children
D) No leaf nodes
Answer: A
Explanation: In a full binary tree, each node has either 0 or exactly 2 children.
Q19. Complete binary tree means:
A) All levels are completely filled except possibly last
B) Every node has 2 children
C) No internal nodes
D) Only leaf nodes exist
Answer: A
Explanation: Complete binary tree fills all levels except possibly the last level from left to right.
Q20. The degree of a node means:
A) Number of children
B) Number of parents
C) Number of roots
D) Number of edges only
Answer: A
Explanation: Degree of a node is the number of children connected to it.
Q21. Which traversal gives sorted output in BST?
A) Preorder
B) Inorder
C) Postorder
D) Level order
Answer: B
Explanation: Inorder traversal of BST produces elements in sorted order.
Q22. Searching in BST average complexity is:
A) O(1)
B) O(log n)
C) O(n²)
D) O(n³)
Answer: B
Explanation: BST provides efficient searching in average case.
Q23. Root node has:
A) No parent
B) No child
C) Two parents
D) Many roots
Answer: A
Explanation: Root is the topmost node and has no parent.
Q24. AVL tree maintains balance using:
A) Rotations
B) Sorting
C) Hashing
D) Queues
Answer: A
Explanation: AVL tree uses left and right rotations to maintain balance.
Q25. Which tree is used in file systems?
A) B-Tree
B) Queue
C) Stack
D) Graph only
Answer: A
Explanation: B-Tree is widely used in file systems and databases.
Q26. Number of nodes at level n in binary tree is:
A) n
B) 2ⁿ
C) n²
D) log n
Answer: B
Explanation: Maximum number of nodes at level n is 2ⁿ.
Q27. Maximum nodes in binary tree of height h is:
A) h
B) 2ʰ − 1
C) h²
D) h + 1
Answer: B
Explanation: Maximum possible nodes in a binary tree of height h is 2ʰ − 1.
Q28. Which tree is self-balancing?
A) BST
B) AVL Tree
C) Binary Tree
D) Expression Tree
Answer: B
Explanation: AVL tree automatically balances itself after insertion and deletion.
Q29. Expression tree is used for:
A) Arithmetic expressions
B) Queue operations
C) Graph search
D) File storage
Answer: A
Explanation: Expression tree represents arithmetic expressions using tree structure.
Q30. Tree with only one child per node is similar to:
A) Array
B) Linked List
C) Queue
D) Hash table
Answer: B
Explanation: Such a tree behaves like a linked list because each node points to only one next node.
Google AdSense Ad Placement Here 📢