When would I want to use a heap?

后端 未结 6 529
醉梦人生
醉梦人生 2021-01-29 23:29

Besides the obvious answer of a Priority Queue, when would a heap be useful in my programming adventures?

6条回答
  •  感情败类
    2021-01-29 23:57

    You can use a minHeap or maxHeap when you want to access the smallest and largest elements respectively.

提交回复
热议问题