[問題] heap調整
開發平台(Platform): (Ex: VC++, GCC, Linux, ...)
c++
額外使用到的函數庫(Library Used): (Ex: OpenGL, ...)
無
問題(Question):
調整失敗
餵入的資料(Input):
number[5] = {10,40,20,5,6}
預期的正確結果(Expected Output):
MAX_Heap tree:40 10 20 5 6
錯誤結果(Wrong Output):
MAX_Heap tree:40 20 10 5 6
程式碼(Code):(請善用置底文網頁, 記得排版)
http://codepad.org/YT7hgcTY
補充說明(Supplement):
http://caterpillar.onlyfun.net/Gossip/AlgorithmGossip/HeapSort.htm
我是拿這個程式碼改的
謝謝
--
※ 發信站: 批踢踢實業坊(ptt.cc)
◆ From: 111.242.12.224
※ 編輯: artorius 來自: 111.242.12.224 (12/15 16:01)
→
12/15 17:48, , 1F
12/15 17:48, 1F
→
12/15 18:12, , 2F
12/15 18:12, 2F
C_and_CPP 近期熱門文章
PTT數位生活區 即時熱門文章