Yahoo Answers is shutting down on May 4th, 2021 (Eastern Time) and the Yahoo Answers website is now in read-only mode. There will be no changes to other Yahoo properties or services, or your Yahoo account. You can find more information about the Yahoo Answers shutdown and how to download your data on this help page.

Heap sort

16 22 6 41 33 16 3 30 如何利用heap sort來進行排序?

請幫我解答一下~~感恩^^

Update:

是Max-Heap~~~

1 Answer

Rating
  • 1 decade ago
    Favorite Answer

    Binary Min-Heap還是Max-Heap?

    2007-12-14 09:46:22 補充:

    可以參考我的回答[Min-Heap]

    http://tw.knowledge.yahoo.com/question/question?qi...

    Max-Heap教學:

    http://www.cs.nchu.edu.tw/~fileman/notepad/ds05.ht...

    幾個主要的步驟:

    1.

               22

           /     \

          16       6

    2.加入41

              41

           /     \

          22       6

         / 

        16

    3.加入33

              41

           /     \

          33       6

         / \

        16   22

    Max-Heap完成圖:

              41

           /     \

          33       16

        /  \     / \

       36    22    6    3

      / 

     16

    Source(s): 自己
Still have questions? Get your answers by asking now.