- AA tree-based data structure
- BA list-based data structure
- CA graph-based data structure
- DNone of the above
Answer: a) A tree-based data structure
Explanation: A heap is a tree-based data structure that satisfies the heap property, which is either the min-heap property or the max-heap property.
Answer: c) Quad heap
Explanation: Quad heap is not a type of heap in data structure.
Answer: b) O(log n)
Explanation: The time complexity of inserting an element into a binary heap of n elements is O(log n).
Answer: c) Parent nodes are greater than child nodes
Explanation: A binary heap can either satisfy the min-heap property or the max-heap property. For a min-heap, the parent nodes are smaller than or equal to the child nodes, while for a max-heap, the parent nodes are greater than or equal to the child nodes.
Answer: b) O(log n)
Explanation: The time complexity of deleting the minimum element from a binary heap of n elements is O(log n).
Answer: d) Depth-first search
Explanation: A heap is not commonly used in depth-first search algorithms.
Answer: b) Fibonacci heap
Explanation: Fibonacci heap has faster amortized time complexity for insert and delete operations compared to other types of heaps.
Answer: d) Build-heap
Explanation: The build-heap operation is used to convert an array into a binary heap.
Answer: d) O(1)
Explanation: The time complexity of finding the minimum element in a binary heap of n elements is O(1).
Answer: c) Additional space required for storage
Explanation: A heap requires additional space for storing the tree structure, which can be a disadvantage in situations where memory usage is a concern.