討論串[問題] STL的make_heap問題
共 2 篇文章
首頁
上一頁
1
下一頁
尾頁

推噓1(1推 0噓 2→)留言3則,0人參與, 最新作者lsc36 (lsc36)時間14年前 (2011/12/04 11:16), 編輯資訊
0
0
0
內容預覽:
make_heap比較大小用的是operator< 所以. struct Node. {. int id, dis;. bool operator< (const Node& b) const { return dis < b.dis; }. };. make_heap是建max heap 如果要m
(還有3個字)

推噓0(0推 0噓 6→)留言6則,0人參與, 最新作者flere (人間失格)時間14年前 (2011/12/03 23:27), 編輯資訊
0
0
0
內容預覽:
最近在研究STL好用的的部分. 想請問一下. <algorithm>裡面的make_heap. 如果我想丟進去的data type是. struct Node{. int id,dis;. }. 的話,. 然後想針對dis的部分作成heap. 那這樣要如何操作呢??. 不太懂要如何改寫自己想要的op
首頁
上一頁
1
下一頁
尾頁