+1 vote
in Data Structures & Algorithms I by (88.2k points)
Heap can be used as ________________

(a) Priority queue

(b) Stack

(c) A decreasing order array

(d) Normal Array

The question is from Heap in section Heap of Data Structures & Algorithms I

This question was addressed to me in final exam.

1 Answer

+1 vote
by (672k points)
selected by
Best answer
Correct choice is (a) Priority queue

For explanation: The property of heap that the value of root must be either greater or less than both of its children makes it work like a priority queue.

Related questions

Welcome to TalkJarvis QnA, a question-answer community website for the people by the people. On TalkJarvis QnA you can ask your doubts, curiosity, questions and whatever going in your mind either related to studies or others. Experts and people from different fields will answer.