[Paper Review] An efficient sorting algorithm - Ultimate Heapsort(UHS)
This paper introduces Ultimate Heapsort (UHS), a comparison-based sorting algorithm that achieves optimal O(n log n) time complexity in all cases—best, average, and worst—while maintaining O(1) space complexity. By leveraging a max-heap structure and efficient heapify operations, UHS outperforms traditional heapsort and quicksort in dynamic environments where insertions and deletions are frequent.
Motivated by the development of computer theory, the sorting algorithm is emerging in an endless stream. Inspired by decrease and conquer method, we propose a brand new sorting algorithmUltimately Heapsort. The algorithm consists of two parts: building a heap and adjusting a heap. Through the asymptotic analysis and experimental analysis of the algorithm, the time complexity of our algorithm can reach O(nlogn) under any condition. Moreover, its space complexity is only O(1). It can be seen that our algorithm is superior to all previous algorithms.
Motivation & Objective
- To design a sorting algorithm that maintains O(n log n) time complexity in all cases, including worst-case scenarios.
- To improve upon traditional heapsort by enhancing performance in dynamic sorting contexts where data is frequently added or removed.
- To achieve optimal time and space complexity simultaneously, making it suitable for in-memory and real-time applications.
- To provide a stable, in-place sorting solution that outperforms quicksort and other comparison-based algorithms under dynamic workloads.
Proposed method
- Uses a max-heap data structure to maintain the heap property, where each parent node is greater than or equal to its children.
- Employs the MAX-HEAPIFY procedure to restore the max-heap property after each extraction of the maximum element.
- Builds the initial max-heap using a bottom-up approach, starting from the last non-leaf node and applying MAX-HEAPIFY to each node.
- Sorts the array by repeatedly swapping the root (maximum) with the last element, reducing the heap size, and re-heapifying the root.
- Applies asymptotic and experimental analysis to validate time complexity across all input types and heap configurations.
- Uses mathematical summations to prove that the total cost of building the heap and maintaining it is O(n), with each heapify operation costing O(log n).
Experimental results
Research questions
- RQ1Can a comparison-based sorting algorithm achieve O(n log n) time complexity in all cases—best, average, and worst—while maintaining O(1) space complexity?
- RQ2How does the performance of UHS compare to quicksort and traditional heapsort in dynamic environments with frequent insertions and deletions?
- RQ3What is the impact of the heapify process on the overall time complexity when building and maintaining the heap structure?
- RQ4Does the use of a max-heap data structure enable better performance in real-world dynamic sorting scenarios compared to other in-place algorithms?
- RQ5Can the algorithm be proven stable under all input conditions, or does it inherently disrupt the relative order of equal elements?
Key findings
- UHS achieves O(n log n) time complexity in all cases—worst-case, average-case, and best-case—making it robust across diverse input distributions.
- The space complexity of UHS is O(1), confirming it as an in-place sorting algorithm that requires no auxiliary storage beyond the input array.
- Experimental results show that UHS outperforms other algorithms in dynamic sorting scenarios involving frequent insertions and deletions.
- The algorithm maintains optimal performance even when data is modified during sorting, unlike quicksort, which degrades under such conditions.
- Asymptotic analysis confirms that the total cost of building the heap and performing heapify operations is O(n), with each operation contributing O(log n) to the total time.
- UHS is not a stable sort, as the heap structure may alter the relative order of equal elements during swaps, particularly during the heapify process on internal nodes.
Better researchstarts right now
From reading papers to final review, dramatically reduce your research time.
No credit card · Free plan available
This review was created by AI and reviewed by human editors.