Site icon T4Tutorials.com

Min-heap MCQs

1. : What is a Min-heap?

(A) A binary tree where the value of each node is less than or equal to the values of its children


(B) A binary tree where the value of each node is greater than or equal to the values of its children


(C) A binary tree where the left subtree is less than the root and the right subtree is greater than the root


(D) A binary tree with no restrictions on node values



2. : Which operation in a Min-heap ensures that the heap property is maintained?

(A) Insertion


(B) Deletion


(C) Both insertion and deletion


(D) Traversal



3. : What is the time complexity of finding the minimum element in a Min-heap?

(A) O(1)


(B) O(log n)


(C) O(n)


(D) O(n log n)



4. : In a Min-heap, which node has the smallest value?

(A) Root node


(B) Leaf nodes


(C) Internal nodes


(D) Any node



5. : Which data structure is commonly used to implement a Min-heap?

(A) Linked list


(B) Array


(C) Stack


(D) Queue



6. : Which operation in a Min-heap removes and returns the minimum element?

(A) Extract-Max


(B) Extract-Min


(C) Delete-Max


(D) Delete-Min



7. : In a Min-heap with n elements, what is the height of the heap?

(A) O(log n)


(B) O(n)


(C) O(n log n)


(D) O(1)



8. : Which operation in a Min-heap inserts a new element while maintaining the heap property?

(A) Insert


(B) Update


(C) Replace


(D) Swap



9. : What is the array representation of a Min-heap?

(A) An array where each element is greater than its parent


(B) An array where each element is less than its parent


(C) An array where each element is equal to its parent


(D) An unordered array



10. : Which traversal method can be used to print all elements of a Min-heap in sorted order?

(A) In-order traversal


(B) Pre-order traversal


(C) Post-order traversal


(D) Level-order traversal



11. : What is the worst-case time complexity of inserting an element into a Min-heap with n elements?

(A) O(1)


(B) O(log n)


(C) O(n)


(D) O(n log n)



12. : Which operation in a Min-heap swaps elements to maintain the heap property?

(A) Swap-Min


(B) Heapify


(C) Balance


(D) Adjust



13. : Which operation in a Min-heap decreases the value of a node and adjusts the heap if necessary?

(A) Decrease-Key


(B) Increase-Key


(C) Modify-Key


(D) Change-Key



14. : Which traversal method of a Min-heap visits nodes level by level?

(A) In-order traversal


(B) Pre-order traversal


(C) Post-order traversal


(D) Level-order traversal



15. : In a Min-heap, which operation retrieves the minimum element without removing it?

(A) Peek-Max


(B) Peek-Min


(C) Peek-Root


(D) Peek-Top



16. : Which operation in a Min-heap ensures that the heap property is restored bottom-up?

(A) Bubble-Up


(B) Bubble-Down


(C) Trickle-Up


(D) Trickle-Down



17. : Which of the following is NOT true about Min-heaps?

(A) The root element is always the minimum element


(B) They are used in priority queues


(C) They are a type of self-balancing tree


(D) They are complete binary trees



18. : Which operation in a Min-heap removes and returns the minimum element, and then restructures the heap?

(A) Remove-Min


(B) Delete-Min


(C) Extract-Min


(D) Pop-Min



19. : In a Min-heap, what is the relationship between a parent node i and its children 2i+1 and 2i+2?

(A) Parent is less than or equal to children


(B) Parent is greater than or equal to children


(C) Parent is equal to children


(D) Parent is not related to children



20. : Which operation in a Min-heap ensures that the heap property is restored top-down?

(A) Bubble-Up


(B) Bubble-Down


(C) Trickle-Up


(D) Trickle-Down



 

 

Data Structures MCQs

Basic Concepts

  1. Introduction to Data Structures
  2. Complexity Analysis MCQs

Linear Data Structures MCQs

  1. Arrays MCQs
  2. Linked Lists MCQs
  3. Stacks MCQs
  4. Queues MCQs

Non-Linear Data Structures MCQs

  1. Trees MCQs
  2. Heaps MCQs
  3. Graphs MCQs

Hashing MCQs MCQs

  1. Hash Tables

Sorting and Searching Algorithms MCQs 

  1. Sorting Algorithms MCQs
  2. Searching Algorithms MCQs

Miscellaneous

  1. Memory Management in data structures MCQs
  2. String Manipulation Algorithms MCQs
  1. Data Structures MCQs 1
  2. Data Structures MCQs 2
  3. Data Structures MCQs 3
  4. Data Structures MCQs 4
  5. Data Structures MCQs 5
  6. Stacks Solved MCQs
  7. Queues MCQs
  8. pointer mcqs
  9. Array MCQs

 

Exit mobile version