Comparison of Pivot Selection Method on Quick Sort Using Central Tendency

  • Rheza Rijaya Universitas Multi Data Palembang
  • Muhammad Ezar Al Rivan
Keywords: Central Tendency, Pivot, Quick Sort

Abstract

Sorting is one of the basic algorithm that executed frequently in a program. The most popular sorting algorithm is Quick Sort because it is faster in most scenarios than other algorithms. However, pivot selection on Quick Sort algorithm is very important to avoid the worst case scenario. This study aims to test commonly used pivot selection methods (first, middle, last) and pivot selection based on central tendency of data (mean, median, mode). The data that is tested are random data (repeated), random data (permutation), sorted, reverse-sorted, and almost sorted. The size of data that is tested are 1.000, 10.000, 100.000, dan 1.000.000. The best result is achieved by selecting middle element as pivot based on the execution time of each scenario.

Published
2023-10-10
How to Cite
Rijaya, R., & Al Rivan, M. E. (2023, October 10). Comparison of Pivot Selection Method on Quick Sort Using Central Tendency. Jurnal Algoritme, 4(1), 13-20. https://doi.org/https://doi.org/10.35957/algoritme.v4i1.5735