1 Star 0 Fork 79

zhizou/javascript-algorithms

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
.github
.husky
assets
src
algorithms
cryptography
graph
image-processing
linked-list
math
ml
search
sets
sorting
__test__
bubble-sort
counting-sort
heap-sort
__test__
HeapSort.js
README.md
insertion-sort
merge-sort
quick-sort
radix-sort
selection-sort
shell-sort
Sort.js
SortTester.js
string
tree
uncategorized
data-structures
playground
utils/comparator
.babelrc
.editorconfig
.eslintrc
.gitignore
.npmrc
BACKERS.md
CODE_OF_CONDUCT.md
CONTRIBUTING.md
LICENSE
README.ar-AR.md
README.es-ES.md
README.fr-FR.md
README.id-ID.md
README.it-IT.md
README.ja-JP.md
README.ko-KR.md
README.md
README.pl-PL.md
README.pt-BR.md
README.ru-RU.md
README.tr-TR.md
README.uk-UA.md
README.zh-CN.md
README.zh-TW.md
jest.config.js
package-lock.json
package.json
克隆/下载
贡献代码
同步代码
取消
提示: 由于 Git 不支持空文件夾,创建文件夹后会生成空的 .keep 文件
Loading...
README

Heap Sort

Heapsort is a comparison-based sorting algorithm. Heapsort can be thought of as an improved selection sort: like that algorithm, it divides its input into a sorted and an unsorted region, and it iteratively shrinks the unsorted region by extracting the largest element and moving that to the sorted region. The improvement consists of the use of a heap data structure rather than a linear-time search to find the maximum.

Algorithm Visualization

Algorithm Visualization

Complexity

Name Best Average Worst Memory Stable Comments
Heap sort n log(n) n log(n) n log(n) 1 No

References

Wikipedia

马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
JavaScript
1
https://gitee.com/zhizous/javascript-algorithms.git
git@gitee.com:zhizous/javascript-algorithms.git
zhizous
javascript-algorithms
javascript-algorithms
master

搜索帮助