C++优先队列的重载(最小堆、最大堆)
C++优先队列默认是最大堆,所以如果我们要用到最小堆,就需要进行重载来使用。 priority_queue的头文件是<queue>. 1.less和greater,不利用struct进 ...
C++优先队列默认是最大堆,所以如果我们要用到最小堆,就需要进行重载来使用。 priority_queue的头文件是<queue>. 1.less和greater,不利用struct进 ...