Binary Search Trees_B Tree — Part 2 MCQs with Explanations
Practice high-yield Computer Science & IT MCQs on Binary Search Trees_B Tree — Part 2 with worked academic solutions for PPSC, FPSC, CSS, PMS, NTS.
Questions
40
Difficulty Level
Exam-Level
Target Exams
PPSC, FPSC, CSS...
Estimated Time
48 mins
Exam-Level PPSC FPSC CSS PMS NTS
Verified for Commission Syllabus • Oct 14, 2026
40
Verified Practice Questions
Interactive test mode with detailed academic worked solutions
Live Progress|0/40 answered
✓0 correct
✗0 wrong
0% score
🎉 Set complete! All 40 questions answered.
Question 1 of 40
★ PPSC
★ FPSC
★ PPSC
★ FPSC
In a Binary Search Tree (BST), how can you find the depth of a particular node?
Correct Answer: Option A — By counting the number of edges from the root to the node.
Detailed Academic Explanation:
By counting the number of edges from the root to the node. is the correct answer to “In a Binary Search Tree (BST), how can you find the depth of a particular node”. This question is standard in competitive examination syllabi for Binary Search Trees_B Tree.
💡Key Conceptual Anchor:Binary Search Trees_B Tree
Question 2 of 40
★ PPSC
★ FPSC
★ PPSC
★ FPSC
What is the typical use case for a Binary Search Tree (BST) in computing?
Correct Answer: Option A — To implement dynamic sets and lookup tables.
Detailed Academic Explanation:
To implement dynamic sets and lookup tables. is the correct answer to “What is the typical use case for a Binary Search Tree (BST) in computing”. This question is standard in competitive examination syllabi for Binary Search Trees_B Tree.
💡Key Conceptual Anchor:Binary Search Trees_B Tree
Question 3 of 40
★ PPSC
★ FPSC
★ PPSC
★ FPSC
What is the result of an inorder traversal of a Binary Search Tree (BST)?
Correct Answer: Option A — Nodes are visited in ascending order.
Detailed Academic Explanation:
Nodes are visited in ascending order. is the correct answer to “What is the result of an inorder traversal of a Binary Search Tree (BST)”. This question is standard in competitive examination syllabi for Binary Search Trees_B Tree.
💡Key Conceptual Anchor:Binary Search Trees_B Tree
Question 4 of 40
★ PPSC
★ FPSC
★ PPSC
★ FPSC
How do you handle duplicate values in a Binary Search Tree (BST) if duplicates are allowed?
Correct Answer: Option A — Insert duplicates into the right subtree or use a counter at each node.
Detailed Academic Explanation:
Insert duplicates into the right subtree or use a counter at each node. is the correct answer to “How do you handle duplicate values in a Binary Search Tree (BST) if duplicates are allowed”. This question is standard in competitive examination syllabi for Binary Search Trees_B Tree.
💡Key Conceptual Anchor:Binary Search Trees_B Tree
Question 5 of 40
★ PPSC
★ FPSC
★ PPSC
★ FPSC
In a Binary Search Tree (BST), what does the term "node height" refer to?
Correct Answer: Option A — The number of edges from the node to its deepest descendant.
Detailed Academic Explanation:
The number of edges from the node to its deepest descendant. is the correct answer to “In a Binary Search Tree (BST), what does the term "node height" refer to”. This question is standard in competitive examination syllabi for Binary Search Trees_B Tree.
💡Key Conceptual Anchor:Binary Search Trees_B Tree
Question 6 of 40
★ PPSC
★ FPSC
★ PPSC
★ FPSC
What is the space complexity of the in-order traversal in the recursive fashion? (d is the tree depth and n is the number of nodes)
Correct Answer: Option D — O(d)
Detailed Academic Explanation:
O(d) is the correct answer to “What is the space complexity of the in-order traversal in the recursive fashion? (d is the tree depth and n is the number of nodes)”. This question is standard in competitive examination syllabi for Binary Search Trees_B Tree.
💡Key Conceptual Anchor:Binary Search Trees_B Tree
Question 7 of 40
★ PPSC
★ FPSC
★ PPSC
★ FPSC
Consider a situation of writing a binary tree into a file with memory storage efficiency in mind, is array representation of tree is good?
Correct Answer: Option C — No it is not efficient in case of sparse trees and remaning cases it is fine
Detailed Academic Explanation:
No it is not efficient in case of sparse trees and remaning cases it is fine is the correct answer to “Consider a situation of writing a binary tree into a file with memory storage efficiency in mind, is array representation of tree is good”. This question is standard in competitive examination syllabi for Binary Search Trees_B Tree.
💡Key Conceptual Anchor:Binary Search Trees_B Tree
Question 8 of 40
★ PPSC
★ FPSC
★ PPSC
★ FPSC
Which of the following is an application of Red-black trees and why?
Correct Answer: Option C — can be used in process schedulers, maps, sets
Detailed Academic Explanation:
can be used in process schedulers, maps, sets is the correct answer to “Which of the following is an application of Red-black trees and why”. This question is standard in competitive examination syllabi for Binary Search Trees_B Tree.
💡Key Conceptual Anchor:Binary Search Trees_B Tree
Question 9 of 40
★ PPSC
★ FPSC
★ PPSC
★ FPSC
What is the worst case analysis of an AA-Tree?
Correct Answer: Option B — O(log N)
Detailed Academic Explanation:
O(log N) is the correct answer to “What is the worst case analysis of an AA-Tree”. This question is standard in competitive examination syllabi for Binary Search Trees_B Tree.
💡Key Conceptual Anchor:Binary Search Trees_B Tree
Question 10 of 40
★ PPSC
★ FPSC
★ PPSC
★ FPSC
Select the code snippet which performs in-order traversal.
Correct Answer: Option B — public void inorder(Tree root) { inorder(root.left); System.out.println(root.data); inorder(root.right); }
Detailed Academic Explanation:
public void inorder(Tree root) { inorder(root.left); System.out.println(root.data); inorder(root.right); } is the correct answer to “Select the code snippet which performs in-order traversal.”. This question is standard in competitive examination syllabi for Binary Search Trees_B Tree.
💡Key Conceptual Anchor:Binary Search Trees_B Tree
Question 11 of 40
★ PPSC
★ FPSC
★ PPSC
★ FPSC
What is the priority of a null node?
Correct Answer: Option D — infinity
Detailed Academic Explanation:
infinity is the correct answer to “What is the priority of a null node”. This question is standard in competitive examination syllabi for Binary Search Trees_B Tree.
💡Key Conceptual Anchor:Binary Search Trees_B Tree
Question 12 of 40
★ PPSC
★ FPSC
★ PPSC
★ FPSC
Why to prefer red-black trees over AVL trees?
Correct Answer: Option B — AVL tree store balance factor in every node which costs space
Detailed Academic Explanation:
AVL tree store balance factor in every node which costs space is the correct answer to “Why to prefer red-black trees over AVL trees”. This question is standard in competitive examination syllabi for Binary Search Trees_B Tree.
💡Key Conceptual Anchor:Binary Search Trees_B Tree
Question 13 of 40
★ PPSC
★ FPSC
★ PPSC
★ FPSC
A self - balancing binary search tree can be used to implement . . . . . . . .
Correct Answer: Option A — Priority queue
Detailed Academic Explanation:
Priority queue is the correct answer to “A self - balancing binary search tree can be used to implement . . . . . . . .”. This question is standard in competitive examination syllabi for Binary Search Trees_B Tree.
💡Key Conceptual Anchor:Binary Search Trees_B Tree
Question 14 of 40
★ PPSC
★ FPSC
★ PPSC
★ FPSC
What output does the below pseudo code produces? Tree_node function(Tree_node x) { Tree_node y = x.left; x.left = y.right; y.right = x; return y; }
Correct Answer: Option A — right rotation of subtree
Detailed Academic Explanation:
right rotation of subtree is the correct answer to “What output does the below pseudo code produces? Tree_node function(Tree_node x) { Tree_node y = x.left; x.left = y.right; y.right = x; return y; }”. This question is standard in competitive examination syllabi for Binary Search Trees_B Tree.
💡Key Conceptual Anchor:Binary Search Trees_B Tree
Question 15 of 40
★ PPSC
★ FPSC
★ PPSC
★ FPSC
What is a Cartesian tree?
Correct Answer: Option C — a tree which obeys heap property and whose inorder traversal yields the given sequence
Detailed Academic Explanation:
a tree which obeys heap property and whose inorder traversal yields the given sequence is the correct answer to “What is a Cartesian tree”. This question is standard in competitive examination syllabi for Binary Search Trees_B Tree.
💡Key Conceptual Anchor:Binary Search Trees_B Tree
Question 16 of 40
★ PPSC
★ FPSC
★ PPSC
★ FPSC
To obtain a prefix expression, which of the tree traversals is used?
Correct Answer: Option B — Pre-order traversal
Detailed Academic Explanation:
Pre-order traversal is the correct answer to “To obtain a prefix expression, which of the tree traversals is used”. This question is standard in competitive examination syllabi for Binary Search Trees_B Tree.
💡Key Conceptual Anchor:Binary Search Trees_B Tree
Question 17 of 40
★ PPSC
★ FPSC
★ PPSC
★ FPSC
What is the special property of red-black trees and what root should always be?
Correct Answer: Option A — a color which is either red or black and root should always be black color only
Detailed Academic Explanation:
a color which is either red or black and root should always be black color only is the correct answer to “What is the special property of red-black trees and what root should always be”. This question is standard in competitive examination syllabi for Binary Search Trees_B Tree.
💡Key Conceptual Anchor:Binary Search Trees_B Tree
Question 18 of 40
★ PPSC
★ FPSC
★ PPSC
★ FPSC
Find the postorder traversal of the binary tree shown below.
Correct Answer: Option C — S W T Q X U V R P
Detailed Academic Explanation:
S W T Q X U V R P is the correct answer to “Find the postorder traversal of the binary tree shown below.”. This question is standard in competitive examination syllabi for Binary Search Trees_B Tree.
💡Key Conceptual Anchor:Binary Search Trees_B Tree
Question 19 of 40
★ PPSC
★ FPSC
★ PPSC
★ FPSC
In a full binary tree if number of internal nodes is I, then number of leaves L are?
Correct Answer: Option B — L = I + 1
Detailed Academic Explanation:
L = I + 1 is the correct answer to “In a full binary tree if number of internal nodes is I, then number of leaves L are”. This question is standard in competitive examination syllabi for Binary Search Trees_B Tree.
💡Key Conceptual Anchor:Binary Search Trees_B Tree
Question 20 of 40
★ PPSC
★ FPSC
★ PPSC
★ FPSC
Several other operations like union set difference and intersection can be done in treaps.
Correct Answer: Option A — True
Detailed Academic Explanation:
True is the correct answer to “Several other operations like union set difference and intersection can be done in treaps.”. This question is standard in competitive examination syllabi for Binary Search Trees_B Tree.
💡Key Conceptual Anchor:Binary Search Trees_B Tree
Question 21 of 40
★ PPSC
★ FPSC
★ PPSC
★ FPSC
Consider a sequence of numbers to have repetitions, how a cartesian tree can be constructed in such situations without violating any rules?
Correct Answer: Option A — use any tie-breaking rule between repeated elements
Detailed Academic Explanation:
use any tie-breaking rule between repeated elements is the correct answer to “Consider a sequence of numbers to have repetitions, how a cartesian tree can be constructed in such situations without violating any rules”. This question is standard in competitive examination syllabi for Binary Search Trees_B Tree.
💡Key Conceptual Anchor:Binary Search Trees_B Tree
Question 22 of 40
★ PPSC
★ FPSC
★ PPSC
★ FPSC
The balance factor of a node in a binary tree is defined as . . . . . . . .
Correct Answer: Option C — height of left subtree minus height of right subtree
Detailed Academic Explanation:
height of left subtree minus height of right subtree is the correct answer to “The balance factor of a node in a binary tree is defined as . . . . . . . .”. This question is standard in competitive examination syllabi for Binary Search Trees_B Tree.
💡Key Conceptual Anchor:Binary Search Trees_B Tree
Question 23 of 40
★ PPSC
★ FPSC
★ PPSC
★ FPSC
What is the code below trying to print? void print(tree *root,tree *node) { if(root ==null) return 0 if(root-->left==node || root-->right==node) || print(root->left,node) ||printf(root->right,node) { print(root->data) } }
Correct Answer: Option C — printing ancestors of a node passed as argument
Detailed Academic Explanation:
printing ancestors of a node passed as argument is the correct answer to “What is the code below trying to print? void print(tree *root,tree *node) { if(root ==null) return 0 if(root-->left==node || root-->right==node) || print(root->left,node) ||printf(root->right,node) { print(root->data) } }”. This question is standard in competitive examination syllabi for Binary Search Trees_B Tree.
💡Key Conceptual Anchor:Binary Search Trees_B Tree
Question 24 of 40
★ PPSC
★ FPSC
★ PPSC
★ FPSC
Which operation is used to combine two auxiliary trees?
Correct Answer: Option A — Join
Detailed Academic Explanation:
Join is the correct answer to “Which operation is used to combine two auxiliary trees”. This question is standard in competitive examination syllabi for Binary Search Trees_B Tree.
💡Key Conceptual Anchor:Binary Search Trees_B Tree
Question 25 of 40
★ PPSC
★ FPSC
★ PPSC
★ FPSC
Using what formula can a parent node be located in an array?
Correct Answer: Option B — (i-1)/2
Detailed Academic Explanation:
(i-1)/2 is the correct answer to “Using what formula can a parent node be located in an array”. This question is standard in competitive examination syllabi for Binary Search Trees_B Tree.
💡Key Conceptual Anchor:Binary Search Trees_B Tree
Question 26 of 40
★ PPSC
★ FPSC
★ PPSC
★ FPSC
Which of the following is also known as Rope data structure?
Correct Answer: Option A — Cord
Detailed Academic Explanation:
Cord is the correct answer to “Which of the following is also known as Rope data structure”. This question is standard in competitive examination syllabi for Binary Search Trees_B Tree.
💡Key Conceptual Anchor:Binary Search Trees_B Tree
Question 27 of 40
★ PPSC
★ FPSC
★ PPSC
★ FPSC
Why to prefer splay trees?
Correct Answer: Option C — easier to program and faster access to recently accessed items
Detailed Academic Explanation:
easier to program and faster access to recently accessed items is the correct answer to “Why to prefer splay trees”. This question is standard in competitive examination syllabi for Binary Search Trees_B Tree.
💡Key Conceptual Anchor:Binary Search Trees_B Tree
Question 28 of 40
★ PPSC
★ FPSC
★ PPSC
★ FPSC
Is Treap a randomized tree.
Correct Answer: Option A — True
Detailed Academic Explanation:
True is the correct answer to “Is Treap a randomized tree.”. This question is standard in competitive examination syllabi for Binary Search Trees_B Tree.
💡Key Conceptual Anchor:Binary Search Trees_B Tree
Question 29 of 40
★ PPSC
★ FPSC
★ PPSC
★ FPSC
What are double and single threaded trees?
Correct Answer: Option A — when both left, right nodes are having null pointers and only right node is null pointer respectively
Detailed Academic Explanation:
when both left, right nodes are having null pointers and only right node is null pointer respectively is the correct answer to “What are double and single threaded trees”. This question is standard in competitive examination syllabi for Binary Search Trees_B Tree.
💡Key Conceptual Anchor:Binary Search Trees_B Tree
Question 30 of 40
★ PPSC
★ FPSC
★ PPSC
★ FPSC
Which of the dynamic operations are used in Top Tree data structure implementation?
Correct Answer: Option D — All of the mentioned
Detailed Academic Explanation:
All of the mentioned is the correct answer to “Which of the dynamic operations are used in Top Tree data structure implementation”. This question is standard in competitive examination syllabi for Binary Search Trees_B Tree.
💡Key Conceptual Anchor:Binary Search Trees_B Tree
Question 31 of 40
★ PPSC
★ FPSC
★ PPSC
★ FPSC
The binary tree sort implemented using a self - balancing binary search tree takes . . . . . . . . time is worst case.
Correct Answer: Option A — O(n log n)
Detailed Academic Explanation:
O(n log n) is the correct answer to “The binary tree sort implemented using a self - balancing binary search tree takes . . . . . . . . time is worst case.”. This question is standard in competitive examination syllabi for Binary Search Trees_B Tree.
💡Key Conceptual Anchor:Binary Search Trees_B Tree
Question 32 of 40
★ PPSC
★ FPSC
★ PPSC
★ FPSC
A treap is a cartesian tree with . . . . . . . .
Correct Answer: Option A — additional value, which is a priority value to the key generated randomly
Detailed Academic Explanation:
additional value, which is a priority value to the key generated randomly is the correct answer to “A treap is a cartesian tree with . . . . . . . .”. This question is standard in competitive examination syllabi for Binary Search Trees_B Tree.
💡Key Conceptual Anchor:Binary Search Trees_B Tree
Question 33 of 40
★ PPSC
★ FPSC
★ PPSC
★ FPSC
How many different shapes does maintenance of AA-Tree need to consider?
Correct Answer: Option C — 2
Detailed Academic Explanation:
2 is the correct answer to “How many different shapes does maintenance of AA-Tree need to consider”. This question is standard in competitive examination syllabi for Binary Search Trees_B Tree.
💡Key Conceptual Anchor:Binary Search Trees_B Tree
Question 34 of 40
★ PPSC
★ FPSC
★ PPSC
★ FPSC
What must be the missing logic in place of missing lines for finding sum of nodes of binary tree in alternate levels? //e.g:-consider -complete binary tree:-height-3, [1,2,3,4,5,6,7]-answer must be 23 n=power(2,height)-1; //assume input is height and a[i] contains tree elements for(i=1;i<=n;) { //present level is initialized to 1 and sum is initialized to 0 for(j=1;j<=pow(2,currentlevel-1);j++) { sum=sum+a[i]; i=i+1; } //missing logic }
Correct Answer: Option A — i=i+pow(2,currentlevel); currentlevel=currentlevel+2; j=1
Detailed Academic Explanation:
i=i+pow(2,currentlevel); currentlevel=currentlevel+2; j=1 is the correct answer to “What must be the missing logic in place of missing lines for finding sum of nodes of binary tree in alternate levels? //e.g:-consider -complete binary tree:-height-3, [1,2,3,4,5,6,7]-answer must be 23 n=power(2,height)-1; //assume input is height and a[i] contains tree elements for(i=1;i<=n;) { //present level is initialized to 1 and sum is initialized to 0 for(j=1;j<=pow(2,currentlevel-1);j++) { sum=sum+a[i]; i=i+1; } //missing logic }”. This question is standard in competitive examination syllabi for Binary Search Trees_B Tree.
💡Key Conceptual Anchor:Binary Search Trees_B Tree
Question 35 of 40
★ PPSC
★ FPSC
★ PPSC
★ FPSC
A full binary tree can be generated using . . . . . . . .
Correct Answer: Option A — post-order and pre-order traversal
Detailed Academic Explanation:
post-order and pre-order traversal is the correct answer to “A full binary tree can be generated using . . . . . . . .”. This question is standard in competitive examination syllabi for Binary Search Trees_B Tree.
💡Key Conceptual Anchor:Binary Search Trees_B Tree
Question 36 of 40
★ PPSC
★ FPSC
★ PPSC
★ FPSC
For a binary tree the first node visited in in-order and post-order traversal is same.
Correct Answer: Option B — False
Detailed Academic Explanation:
False is the correct answer to “For a binary tree the first node visited in in-order and post-order traversal is same.”. This question is standard in competitive examination syllabi for Binary Search Trees_B Tree.
💡Key Conceptual Anchor:Binary Search Trees_B Tree
Question 37 of 40
★ PPSC
★ FPSC
★ PPSC
★ FPSC
Advantages of linked list representation of binary trees over arrays?
Correct Answer: Option D — both dynamic size and ease in insertion/deletion
Detailed Academic Explanation:
both dynamic size and ease in insertion/deletion is the correct answer to “Advantages of linked list representation of binary trees over arrays”. This question is standard in competitive examination syllabi for Binary Search Trees_B Tree.
💡Key Conceptual Anchor:Binary Search Trees_B Tree
Question 38 of 40
★ PPSC
★ FPSC
★ PPSC
★ FPSC
Is the below tree representation of 50, 100,400,300,280 correct way to represent cartesian tree?
Correct Answer: Option A — true
Detailed Academic Explanation:
true is the correct answer to “Is the below tree representation of 50, 100,400,300,280 correct way to represent cartesian tree”. This question is standard in competitive examination syllabi for Binary Search Trees_B Tree.
💡Key Conceptual Anchor:Binary Search Trees_B Tree
Question 39 of 40
★ PPSC
★ FPSC
★ PPSC
★ FPSC
What is the space complexity of the post-order traversal in the recursive fashion? (d is the tree depth and n is the number of nodes)
Correct Answer: Option D — O(d)
Detailed Academic Explanation:
O(d) is the correct answer to “What is the space complexity of the post-order traversal in the recursive fashion? (d is the tree depth and n is the number of nodes)”. This question is standard in competitive examination syllabi for Binary Search Trees_B Tree.
💡Key Conceptual Anchor:Binary Search Trees_B Tree
Question 40 of 40
★ PPSC
★ FPSC
★ PPSC
★ FPSC
What is wrong with below code for inorder traversal of inorder threaded binary tree: inordertraversal(threadedtreenode root): threadedtreenode q = inorderpredecessor(root) while(q!=root): q=inorderpredecessor(q) print q.data
Correct Answer: Option A — inordersuccessor instead of inorderpredecessor must be done
Detailed Academic Explanation:
inordersuccessor instead of inorderpredecessor must be done is the correct answer to “What is wrong with below code for inorder traversal of inorder threaded binary tree: inordertraversal(threadedtreenode root): threadedtreenode q = inorderpredecessor(root) while(q!=root): q=inorderpredecessor(q) print q.data”. This question is standard in competitive examination syllabi for Binary Search Trees_B Tree.
💡Key Conceptual Anchor:Binary Search Trees_B Tree
✓Link copied to clipboard
Continue Your Practice
Advanced Mapreduce Concepts — Part 1
Master the next curriculum module with 40 exam-standard MCQs.
In competitive commission exams (FPSC, PPSC, KPPSC, SPSC, CSS, PMS), questions are frequently phrased with distractor options designed to catch rote learners. Whenever you answer an MCQ, read the Detailed Academic Explanation and Conceptual Anchor to understand why the remaining options are incorrect.