API\ 具体实现慢慢补上。
1. 第一种调用方法(最小堆)
struct ListNode
{
ListNode* next;
int val;
ListNode(int x): val(x), next(NULL) {}
};
struct cmp
{
bool operator () (const ListNode* a, const ListNode* b)
{
return a->val > b->val;
}
};
int main()
{
priority_queue<ListNode*, vector<ListNode*>, cmp> q;
return 0;
}