Heapsort
Worst-case optimal in-place comparison sorting algorithm based on the heap data structure
In computer science, heapsort is an efficient, comparison-based sorting algorithm that reorganizes an input array into a heap (a data structure where each node is greater than its children) and then repeatedly removes the largest node from that heap, placing it at the end of the array in a similar manner to Selection sort. Although somewhat slower in practice on most machines than a well-implemented quicksort, it has the advantages of very simple implementation and a more favorable worst-case O(n log n) runtime.
Nº Q474095 ★★
Uncommon · Knowledge
Heapsort
Worst-case optimal in-place comparison sorting algorithm based on the heap data structure
In computer science, heapsort is an efficient, comparison-based sorting algorithm that reorganizes an input array into a heap (a data structure where each node is greater than its children) and then repeatedly removes the largest node from that heap, placing it at the end of the array in a similar manner to Selection sort. Although somewhat slower in practice on most machines than a well-implemented quicksort, it has the advantages of very simple implementation and a more favorable worst-case O(n log n) runtime.
Last price
—
Floor price
—
7-day median
—
30-day sales
0
30-day range
—
In circulation
0
Price history
median
low – high
sales
No sales in this period
Show table
| Date | median | Low | High | sales |
|---|
Sales history
- Last sale
- —
- 30-day average
- —
- 30-day low
- —
- 30-day high
- —
- Sales 7d
- 0
- Sales 30d
- 0
No sales yet.
Anonymous sales: no buyer or seller shown. Figures count player-to-player sales only.
From Wikipedia
In computer science, heapsort is an efficient, comparison-based sorting algorithm that reorganizes an input array into a heap (a data structure where each node is greater than its children) and then repeatedly removes the largest node from that heap, placing it at the end of the array in a similar manner to Selection sort. Although somewhat slower in practice on most machines than a well-implemented quicksort, it has the advantages of very simple implementation and a more favorable worst-case O(n log n) runtime. Most real-world quicksort variants include an implementation of heapsort as a fallback should they detect that quicksort is becoming degenerate. Heapsort is an in-place algorithm, but it is not a stable sort. Heapsort was invented by J. W. J. Williams in 1964. The paper also introduced the binary heap as a useful data structure in its own right. In the same year, Robert W. Floyd published an improved version that could sort an array in-place, continuing his earlier research into the treesort algorithm.
Text: Wikipédia, CC BY-SA 4.0. · Image: Explorer09 (CC0) ·
Related cards
Heap (data structure)
Tree-based data structure in computer science
Nº Q274089 ★★★
Timsort
Hybrid sorting algorithm based on insertion sort and merge sort
Nº Q942403 ★★★
Hill climbing
Optimization algorithm
Nº Q820272 ★
Bubble sort
Simple sorting algorithm
Nº Q60864 ★★★
Insertion sort
Sorting algorithm that, at each iteration, inserts the current input element into the suitable position between the already sorted elements
Nº Q117241 ★★
Bogosort
Highly ineffective sorting algorithm that successively generates permutations of its input until it finds one that is sorted
Nº Q762850 ★★★