Heap Sort (Sắp xếp kiểu vun đống)

Sắp xếp vun đống (Heapsort) dựa trên một cấu trúc dữ liệu được gọi là đống nhị phân ([binary] heap), gọi đơn giản là đống. Trong mục này chỉ nói về đống trong bài toán sắp xếp.

By English

Heapsort is a comparison-based sorting algorithm to create a sorted array (or list), and is part of the selection sort family. Although somewhat slower in practice on most machines than a well-implemented quicksort, it has the advantage of a more favorable worst-case O(n log n) runtime. Heapsort is an in-place algorithm, but it is not a stable sort. It was invented by J. W. J. Williams in 1964.

Like Doanh nhân số