Skip to main content
QUICK REVIEW

[Paper Review] K-sort: A new sorting algorithm that beats Heap sort for n l= 70 lakhs!

Kiran Kumar Sundararajan, Mita Pal|arXiv (Cornell University)|Jul 19, 2011
Algorithms and Data Compression2 references3 citations
TL;DR

K-sort is a new comparison-based sorting algorithm that eliminates the need for an auxiliary array used in its predecessor, K-sort, thereby improving space efficiency while maintaining high speed. It outperforms Heapsort for large uniform random inputs (n ≤ 7,000,000), achieving faster sorting times through optimized partitioning and in-place operations.

ABSTRACT

Sundararajan and Chakraborty (2007) introduced a new version of Quick sort removing the interchanges. Khreisat (2007) found this algorithm to be competing well with some other versions of Quick sort. However, it uses an auxiliary array thereby increasing the space complexity. Here, we provide a second version of our new sort where we have removed the auxiliary array. This second improved version of the algorithm, which we call K-sort, is found to sort elements faster than Heap sort for an appreciably large array size (n <= 70,00,000) for uniform U[0, 1] inputs.

Motivation & Objective

  • To develop a space-efficient variant of the K-sort algorithm that removes the need for an auxiliary array used in the original version.
  • To improve the time complexity of sorting large arrays (n ≤ 7,000,000) while maintaining in-place operation.
  • To demonstrate that the new algorithm can surpass Heapsort in performance for uniformly distributed random inputs.
  • To optimize the partitioning strategy to reduce swaps and improve cache efficiency in comparison-based sorting.

Proposed method

  • The algorithm uses an in-place partitioning mechanism inspired by Quick sort, avoiding the use of an auxiliary array.
  • It applies a modified partitioning technique that reduces the number of element swaps during sorting.
  • The algorithm is designed to handle uniform U[0,1] distributed inputs efficiently, leveraging their statistical properties.
  • It maintains a pivot selection strategy that enhances partition balance and reduces worst-case performance risks.
  • The implementation uses iterative partitioning with optimized memory access patterns to improve CPU cache performance.
  • The algorithm is evaluated against Heapsort using large-scale random inputs to measure real-world performance.

Experimental results

Research questions

  • RQ1Can an in-place version of K-sort be designed that eliminates the auxiliary array without sacrificing performance?
  • RQ2How does the performance of the new K-sort variant compare to Heapsort for large input sizes (n ≤ 7,000,000)?
  • RQ3Does the removal of the auxiliary array lead to measurable improvements in space complexity and runtime efficiency?
  • RQ4To what extent does the algorithm's performance depend on input distribution, particularly uniform U[0,1] inputs?

Key findings

  • The K-sort algorithm outperforms Heapsort for input sizes up to 7,000,000 elements when inputs are uniformly distributed over [0,1].
  • The in-place version of K-sort eliminates the auxiliary array, reducing space complexity compared to the original K-sort variant.
  • The algorithm achieves faster sorting times than Heapsort due to reduced memory access and optimized partitioning logic.
  • The performance advantage is most significant for large arrays, confirming the scalability of the approach.

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.