Click here to see the full article post
why does priority queue method need extra space?? the space should be o(1)
We often implement priority queue by heap, and the heap costs O(k) space. It's such a small space cost generally, but it might be large if we have lots of linked-list to merge.
Looks like your connection to LeetCode Discuss was lost, please wait while we try to reconnect.