Is there a C++ MinMax Heap implementation?

前端 未结 5 1790
暖寄归人
暖寄归人 2020-12-31 06:51

I\'m looking for algorithms like ones in the stl (push_heap, pop_heap, make_heap) except with the ability to pop both the minimum and

5条回答
  •  一整个雨季
    2020-12-31 07:17

    Is there a reason you can't use std::set? It sounds like that, along with some wrappers to access and remove set::begin() and --set::end() will solve the problem. I imagine it will be difficult to find something that can generally do a MinMax Heap much faster than the default implementation of set.

提交回复
热议问题