「Heap Sort」的原理

2008-04-30 2:40 am
我想知「Heap Sort」的原理,唔該用中文,難明不要緊,但一定要扼要!

回答 (1)

2008-05-01 11:20 am
✔ 最佳答案
Heap is explained in 維基百科
http://zh.wikipedia.org/wiki/堆
The Wiki explanation of heaps is a little more graphical in English
http://en.wikipedia.org/wiki/Heap_(data_structure)

Heap sort is nothing more than creating a heap, and then removing the root element one by one, and automatically it is in ascending order.
The part of heap sort that is harder to understand is maintaining a heap in place, as in an array. This is explained again in 維基百科
http://zh.wikipedia.org/wiki/堆積排序
or in English, it is explained in more detail:
http://en.wikipedia.org/wiki/Heapsort

If you need more details, I can give you more specific explanations. As I am limited to 3 posts a day and 300 characters in subsequent posts, it is easier if you could post me your e-mail address to communicate directly.


收錄日期: 2021-04-13 15:29:32
原文連結 [永久失效]:
https://hk.answers.yahoo.com/question/index?qid=20080429000051KK01870

檢視 Wayback Machine 備份