Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我已经实现了一个 minHeap 类,所以我很好奇,如果不修改代码,是否可以将 minHeap 类用作最大堆?
只需在将所有值放入堆之前翻转它们的符号,然后再将它们从堆中取出。