Practice high-yield Computer Science & IT MCQs on Heaps — 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
What operation is performed to convert a binary heap into a sorted array?
Correct Answer: Option A — Heapsort
Detailed Academic Explanation:
Heapsort is the correct answer to “What operation is performed to convert a binary heap into a sorted array”. This question is standard in competitive examination syllabi for Heaps.
💡Key Conceptual Anchor:Heaps
Question 2 of 40
★ PPSC
★ FPSC
★ PPSC
★ FPSC
In which situation would you prefer using a Fibonacci heap over a binary heap?
Correct Answer: Option A — When frequent decrease-key operations are required.
Detailed Academic Explanation:
When frequent decrease-key operations are required. is the correct answer to “In which situation would you prefer using a Fibonacci heap over a binary heap”. This question is standard in competitive examination syllabi for Heaps.
💡Key Conceptual Anchor:Heaps
Question 3 of 40
★ PPSC
★ FPSC
★ PPSC
★ FPSC
Which algorithm uses a binary heap to improve its performance?
Correct Answer: Option C — Prim's algorithm for minimum spanning tree.
Detailed Academic Explanation:
Prim's algorithm for minimum spanning tree. is the correct answer to “Which algorithm uses a binary heap to improve its performance”. This question is standard in competitive examination syllabi for Heaps.
💡Key Conceptual Anchor:Heaps
Question 4 of 40
★ PPSC
★ FPSC
★ PPSC
★ FPSC
What is the maximum number of children a node can have in a binary heap?
Correct Answer: Option A — 2
Detailed Academic Explanation:
2 is the correct answer to “What is the maximum number of children a node can have in a binary heap”. This question is standard in competitive examination syllabi for Heaps.
💡Key Conceptual Anchor:Heaps
Question 5 of 40
★ PPSC
★ FPSC
★ PPSC
★ FPSC
How do you ensure that a binary heap remains a valid heap after multiple insertions?
Correct Answer: Option A — By performing a heapify operation after each insertion.
Detailed Academic Explanation:
By performing a heapify operation after each insertion. is the correct answer to “How do you ensure that a binary heap remains a valid heap after multiple insertions”. This question is standard in competitive examination syllabi for Heaps.
💡Key Conceptual Anchor:Heaps
Question 6 of 40
★ PPSC
★ FPSC
★ PPSC
★ FPSC
Multiplication and division to find children and parents cannot be implemented in a d-heap.
Correct Answer: Option B — false
Detailed Academic Explanation:
false is the correct answer to “Multiplication and division to find children and parents cannot be implemented in a d-heap.”. This question is standard in competitive examination syllabi for Heaps.
💡Key Conceptual Anchor:Heaps
Question 7 of 40
★ PPSC
★ FPSC
★ PPSC
★ FPSC
A leftist heap is also said to be a binary heap.
Correct Answer: Option A — true
Detailed Academic Explanation:
true is the correct answer to “A leftist heap is also said to be a binary heap.”. This question is standard in competitive examination syllabi for Heaps.
💡Key Conceptual Anchor:Heaps
Question 8 of 40
★ PPSC
★ FPSC
★ PPSC
★ FPSC
Who invented d-ary heap?
Correct Answer: Option C — Donald Johnson
Detailed Academic Explanation:
Donald Johnson is the correct answer to “Who invented d-ary heap”. This question is standard in competitive examination syllabi for Heaps.
💡Key Conceptual Anchor:Heaps
Question 9 of 40
★ PPSC
★ FPSC
★ PPSC
★ FPSC
What is the child of smallest element of the given minimum ternary heap?
Correct Answer: Option B — 10
Detailed Academic Explanation:
10 is the correct answer to “What is the child of smallest element of the given minimum ternary heap”. This question is standard in competitive examination syllabi for Heaps.
💡Key Conceptual Anchor:Heaps
Question 10 of 40
★ PPSC
★ FPSC
★ PPSC
★ FPSC
Heap can be used as . . . . . . . .
Correct Answer: Option A — Priority queue
Detailed Academic Explanation:
Priority queue is the correct answer to “Heap can be used as . . . . . . . .”. This question is standard in competitive examination syllabi for Heaps.
💡Key Conceptual Anchor:Heaps
Question 11 of 40
★ PPSC
★ FPSC
★ PPSC
★ FPSC
The procedure given below is used to maintain min-order in the min heap. Find out the missing statements, represented as X. procedure TrickleDownMin(i) if A[i] has children then m := index of smallest of the children or grandchildren (if any) of A[i] if A[m] is a grandchild of A[i] then if A[m] < A[i] then swap A[i] and A[m] X: _______________________ ____________________ endif TrickleDownMin(m) endif else //{A[m] is a child of A[i]} if A[m] << A[i] then swap A[i] and A[m] endif endif
Correct Answer: Option A — if A[m] > A[parent(m)] then swap A[m] and A[parent(m)]
Detailed Academic Explanation:
if A[m] > A[parent(m)] then swap A[m] and A[parent(m)] is the correct answer to “The procedure given below is used to maintain min-order in the min heap. Find out the missing statements, represented as X. procedure TrickleDownMin(i) if A[i] has children then m := index of smallest of the children or grandchildren (if any) of A[i] if A[m] is a grandchild of A[i] then if A[m] < A[i] then swap A[i] and A[m] X: _______________________ ____________________ endif TrickleDownMin(m) endif else //{A[m] is a child of A[i]} if A[m] << A[i] then swap A[i] and A[m] endif endif”. This question is standard in competitive examination syllabi for Heaps.
💡Key Conceptual Anchor:Heaps
Question 12 of 40
★ PPSC
★ FPSC
★ PPSC
★ FPSC
Why is this heap named leftist heap?
Correct Answer: Option B — the tree is biased to get deep down the left
Detailed Academic Explanation:
the tree is biased to get deep down the left is the correct answer to “Why is this heap named leftist heap”. This question is standard in competitive examination syllabi for Heaps.
💡Key Conceptual Anchor:Heaps
Question 13 of 40
★ PPSC
★ FPSC
★ PPSC
★ FPSC
What is the space complexity of searching in a heap?
Correct Answer: Option B — O(n)
Detailed Academic Explanation:
O(n) is the correct answer to “What is the space complexity of searching in a heap”. This question is standard in competitive examination syllabi for Heaps.
💡Key Conceptual Anchor:Heaps
Question 14 of 40
★ PPSC
★ FPSC
★ PPSC
★ FPSC
Which of the following operations does not destroy the leftist heap property?
Correct Answer: Option C — delete
Detailed Academic Explanation:
delete is the correct answer to “Which of the following operations does not destroy the leftist heap property”. This question is standard in competitive examination syllabi for Heaps.
💡Key Conceptual Anchor:Heaps
Question 15 of 40
★ PPSC
★ FPSC
★ PPSC
★ FPSC
The main distinguishable characterstic of a binomial heap from a binary heap is that
Correct Answer: Option A — it allows union operations very efficiently
Detailed Academic Explanation:
it allows union operations very efficiently is the correct answer to “The main distinguishable characterstic of a binomial heap from a binary heap is that”. This question is standard in competitive examination syllabi for Heaps.
💡Key Conceptual Anchor:Heaps
Question 16 of 40
★ PPSC
★ FPSC
★ PPSC
★ FPSC
How many basic operations can be performed in a d-heap?
Correct Answer: Option B — 2
Detailed Academic Explanation:
2 is the correct answer to “How many basic operations can be performed in a d-heap”. This question is standard in competitive examination syllabi for Heaps.
💡Key Conceptual Anchor:Heaps
Question 17 of 40
★ PPSC
★ FPSC
★ PPSC
★ FPSC
What is the time complexity for deleting root key in a ternary heap of n elements?
Correct Answer: Option B — O (3log n/ log 3)
Detailed Academic Explanation:
O (3log n/ log 3) is the correct answer to “What is the time complexity for deleting root key in a ternary heap of n elements”. This question is standard in competitive examination syllabi for Heaps.
💡Key Conceptual Anchor:Heaps
Question 18 of 40
★ PPSC
★ FPSC
★ PPSC
★ FPSC
What is the reason for the efficiency of a pairing heap?
Correct Answer: Option A — simplicity
Detailed Academic Explanation:
simplicity is the correct answer to “What is the reason for the efficiency of a pairing heap”. This question is standard in competitive examination syllabi for Heaps.
💡Key Conceptual Anchor:Heaps
Question 19 of 40
★ PPSC
★ FPSC
★ PPSC
★ FPSC
If there are c children of the root, how many calls to the merge procedure is required to reassemble the heap?
Correct Answer: Option C — c-1
Detailed Academic Explanation:
c-1 is the correct answer to “If there are c children of the root, how many calls to the merge procedure is required to reassemble the heap”. This question is standard in competitive examination syllabi for Heaps.
💡Key Conceptual Anchor:Heaps
Question 20 of 40
★ PPSC
★ FPSC
★ PPSC
★ FPSC
What is order of resultant heap after merging two tree of order k?
Correct Answer: Option B — k+1
Detailed Academic Explanation:
k+1 is the correct answer to “What is order of resultant heap after merging two tree of order k”. This question is standard in competitive examination syllabi for Heaps.
💡Key Conceptual Anchor:Heaps
Question 21 of 40
★ PPSC
★ FPSC
★ PPSC
★ FPSC
Min heap can be used to implement selection sort.
Correct Answer: Option A — True
Detailed Academic Explanation:
True is the correct answer to “Min heap can be used to implement selection sort.”. This question is standard in competitive examination syllabi for Heaps.
💡Key Conceptual Anchor:Heaps
Question 22 of 40
★ PPSC
★ FPSC
★ PPSC
★ FPSC
What would be the result if the left subtree of the root has a null path length of 1 and the right subtree has a null path length of 2?
Correct Answer: Option D — violation at the root
Detailed Academic Explanation:
violation at the root is the correct answer to “What would be the result if the left subtree of the root has a null path length of 1 and the right subtree has a null path length of 2”. This question is standard in competitive examination syllabi for Heaps.
💡Key Conceptual Anchor:Heaps
Question 23 of 40
★ PPSC
★ FPSC
★ PPSC
★ FPSC
What will be the order of new heap created after union of heap H1 and H2 when created by the following code.Initially both are of the order n. FIB_UNION(H1,H2) { H =MAKE_HEAP() min[H]= min[H1] concatenate the root list of H2 with the root list of H if (min[H1] = NIL) or (min[H2]!= NIL and min[H2] < min[H1]) then min[H] = min[H2] n[H]= n[H1] + n[H2] free the objects H1 and H2 return H }
Correct Answer: Option A — n+1
Detailed Academic Explanation:
n+1 is the correct answer to “What will be the order of new heap created after union of heap H1 and H2 when created by the following code.Initially both are of the order n. FIB_UNION(H1,H2) { H =MAKE_HEAP() min[H]= min[H1] concatenate the root list of H2 with the root list of H if (min[H1] = NIL) or (min[H2]!= NIL and min[H2] < min[H1]) then min[H] = min[H2] n[H]= n[H1] + n[H2] free the objects H1 and H2 return H }”. This question is standard in competitive examination syllabi for Heaps.
💡Key Conceptual Anchor:Heaps
Question 24 of 40
★ PPSC
★ FPSC
★ PPSC
★ FPSC
What is the complexity of adding an element to the heap.
Correct Answer: Option C — O(log n) & O(h)
Detailed Academic Explanation:
O(log n) & O(h) is the correct answer to “What is the complexity of adding an element to the heap.”. This question is standard in competitive examination syllabi for Heaps.
💡Key Conceptual Anchor:Heaps
Question 25 of 40
★ PPSC
★ FPSC
★ PPSC
★ FPSC
Is decrease priority operation performed more quickly in a ternary heap with respect to the binary heap.
Correct Answer: Option A — True
Detailed Academic Explanation:
True is the correct answer to “Is decrease priority operation performed more quickly in a ternary heap with respect to the binary heap.”. This question is standard in competitive examination syllabi for Heaps.
💡Key Conceptual Anchor:Heaps
Question 26 of 40
★ PPSC
★ FPSC
★ PPSC
★ FPSC
Do ternary heap have better memory cache behavior than binary heap.
Correct Answer: Option A — True
Detailed Academic Explanation:
True is the correct answer to “Do ternary heap have better memory cache behavior than binary heap.”. This question is standard in competitive examination syllabi for Heaps.
💡Key Conceptual Anchor:Heaps
Question 27 of 40
★ PPSC
★ FPSC
★ PPSC
★ FPSC
d-heap is similar to that of a?
Correct Answer: Option A — binary heap
Detailed Academic Explanation:
binary heap is the correct answer to “d-heap is similar to that of a”. This question is standard in competitive examination syllabi for Heaps.
💡Key Conceptual Anchor:Heaps
Question 28 of 40
★ PPSC
★ FPSC
★ PPSC
★ FPSC
What is the fundamental operation on leftist heap?
Correct Answer: Option B — merging
Detailed Academic Explanation:
merging is the correct answer to “What is the fundamental operation on leftist heap”. This question is standard in competitive examination syllabi for Heaps.
💡Key Conceptual Anchor:Heaps
Question 29 of 40
★ PPSC
★ FPSC
★ PPSC
★ FPSC
What is the smallest element of the given minimum ternary heap?
Correct Answer: Option A — 1
Detailed Academic Explanation:
1 is the correct answer to “What is the smallest element of the given minimum ternary heap”. This question is standard in competitive examination syllabi for Heaps.
💡Key Conceptual Anchor:Heaps
Question 30 of 40
★ PPSC
★ FPSC
★ PPSC
★ FPSC
State the complexity of algorithm given below. int function(vector<int> arr) int len=arr.length(); if(len==0) return; temp=arr[len-1]; arr.pop_back(); return temp;
Correct Answer: Option C — O(1)
Detailed Academic Explanation:
O(1) is the correct answer to “State the complexity of algorithm given below. int function(vector<int> arr) int len=arr.length(); if(len==0) return; temp=arr[len-1]; arr.pop_back(); return temp;”. This question is standard in competitive examination syllabi for Heaps.
💡Key Conceptual Anchor:Heaps
Question 31 of 40
★ PPSC
★ FPSC
★ PPSC
★ FPSC
What is the process of building a ternary heap called?
Correct Answer: Option A — Heapify
Detailed Academic Explanation:
Heapify is the correct answer to “What is the process of building a ternary heap called”. This question is standard in competitive examination syllabi for Heaps.
💡Key Conceptual Anchor:Heaps
Question 32 of 40
★ PPSC
★ FPSC
★ PPSC
★ FPSC
Which operation is not efficiently performed in a d-heap?
Correct Answer: Option D — merge
Detailed Academic Explanation:
merge is the correct answer to “Which operation is not efficiently performed in a d-heap”. This question is standard in competitive examination syllabi for Heaps.
💡Key Conceptual Anchor:Heaps
Question 33 of 40
★ PPSC
★ FPSC
★ PPSC
★ FPSC
In a binary min heap containing n elements, the largest element can be found in . . . . . . . . time.
Correct Answer: Option A — O(n)
Detailed Academic Explanation:
O(n) is the correct answer to “In a binary min heap containing n elements, the largest element can be found in . . . . . . . . time.”. This question is standard in competitive examination syllabi for Heaps.
💡Key Conceptual Anchor:Heaps
Question 34 of 40
★ PPSC
★ FPSC
★ PPSC
★ FPSC
What is the worst case time in searching minimum value in weak -heap?
Correct Answer: Option D — O(1)
Detailed Academic Explanation:
O(1) is the correct answer to “What is the worst case time in searching minimum value in weak -heap”. This question is standard in competitive examination syllabi for Heaps.
💡Key Conceptual Anchor:Heaps
Question 35 of 40
★ PPSC
★ FPSC
★ PPSC
★ FPSC
Pairing heaps time complexity was inspired by that of?
Correct Answer: Option A — splay tree
Detailed Academic Explanation:
splay tree is the correct answer to “Pairing heaps time complexity was inspired by that of”. This question is standard in competitive examination syllabi for Heaps.
💡Key Conceptual Anchor:Heaps
Question 36 of 40
★ PPSC
★ FPSC
★ PPSC
★ FPSC
What is the time complexity for inserting a new item in a ternary heap of n elements?
Correct Answer: Option A — O (log n/ log 3)
Detailed Academic Explanation:
O (log n/ log 3) is the correct answer to “What is the time complexity for inserting a new item in a ternary heap of n elements”. This question is standard in competitive examination syllabi for Heaps.
💡Key Conceptual Anchor:Heaps
Question 37 of 40
★ PPSC
★ FPSC
★ PPSC
★ FPSC
What will be the position of 5, when a max heap is constructed on the input elements 5, 70, 45, 7, 12, 15, 13, 65, 30, 25?
Correct Answer: Option B — 5 will be at last level
Detailed Academic Explanation:
5 will be at last level is the correct answer to “What will be the position of 5, when a max heap is constructed on the input elements 5, 70, 45, 7, 12, 15, 13, 65, 30, 25”. This question is standard in competitive examination syllabi for Heaps.
💡Key Conceptual Anchor:Heaps
Question 38 of 40
★ PPSC
★ FPSC
★ PPSC
★ FPSC
What are the siblings of smallest element of the given maximum ternary heap?
Correct Answer: Option C — 18
Detailed Academic Explanation:
18 is the correct answer to “What are the siblings of smallest element of the given maximum ternary heap”. This question is standard in competitive examination syllabi for Heaps.
💡Key Conceptual Anchor:Heaps
Question 39 of 40
★ PPSC
★ FPSC
★ PPSC
★ FPSC
What is the time complexity for decreasing priority of key in a minimum ternary heap of n elements?
Correct Answer: Option A — O (log n/ log 3)
Detailed Academic Explanation:
O (log n/ log 3) is the correct answer to “What is the time complexity for decreasing priority of key in a minimum ternary heap of n elements”. This question is standard in competitive examination syllabi for Heaps.
💡Key Conceptual Anchor:Heaps
Question 40 of 40
★ PPSC
★ FPSC
★ PPSC
★ FPSC
Choose the correct properties of weak-heap.
Correct Answer: Option B — Every right child of node has greater value than parent node
Detailed Academic Explanation:
Every right child of node has greater value than parent node is the correct answer to “Choose the correct properties of weak-heap.”. This question is standard in competitive examination syllabi for Heaps.
💡Key Conceptual Anchor:Heaps
✓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.