c++優先隊列,小根堆

一直對priority不會,如今要記一下了c++ priority_queue<int,vector<int>,greater<int> >q; 這樣的話,咱們能夠獲得一個小根堆; 意思大概是<類型,<存儲方式>,<比較函數> >; 可是這個小根堆只能支持int; 反正我不會啦;web struct cs{ int x; bool operator < (const cs &rhs
相關文章
相關標籤/搜索