Heap can be used as ________________

Category: QuestionsHeap can be used as ________________
Editor">Editor Staff asked 5 months ago

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 Answers
Editor">Editor Staff answered 5 months ago

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.


Notice: Trying to get property 'ID' of non-object in /home/fvckxqmi/public_html/wp-content/themes/blocksy/inc/single/single-helpers.php on line 17

Notice: Trying to get property 'ID' of non-object in /home/fvckxqmi/public_html/wp-content/themes/blocksy/inc/single/single-helpers.php on line 17

Notice: Trying to get property 'ID' of non-object in /home/fvckxqmi/public_html/wp-content/themes/blocksy/inc/single/single-helpers.php on line 17

Notice: Trying to get property 'ID' of non-object in /home/fvckxqmi/public_html/wp-content/themes/blocksy/inc/single/single-helpers.php on line 17
Articles: 40702