Title: A comprehensive analysis of classical sorting algorithms with diverse input conditions
Authors: Mohsen Mohammadagha
Addresses: Department of Civil Engineering, University of Texas at Arlington, Arlington, Texas, USA
Abstract: This study presents a comprehensive analysis of six classical sorting algorithms - Mergesort, Heapsort, Quicksort (with median-of-three pivot), Insertion Sort, Selection Sort, and Bubble Sort - to evaluate their practical efficiency across diverse input conditions. While theoretical complexity (O(n2) vs. O(nlog(n))) provides foundational insights, real-world performance depends on implementation-specific factors, input size, and data distribution. The research addresses the critical need to bridge theoretical predictions with empirical benchmarks, particularly as modern computing environments demand optimised algorithm selection for varying workloads. Using Python-based implementations, the methodology systematically tests algorithms on arrays (size 10-100,000) with randomised, sorted, reverse-sorted, and custom patterns, measuring execution times and memory usage. Results reveal quadratic algorithms outperform O(nlog(n)) methods for small datasets (e.g., Selection Sort: 0.000004s at n = 10), while Quicksort dominates at scale (0.089s vs. Bubble Sort's 265.93s at n = 100,000). Logarithmic visualisations highlight exponential efficiency divergence, with O(nlog(n)) algorithms achieving 2,900× speedup over O(n2) counterparts for large arrays. Future research should explore adaptive hybrid systems leveraging machine learning for dynamic input adaptation, energy-efficient sorting in embedded systems, and quantum computing architectures. This work provides actionable insights for optimising algorithm selection in data-intensive applications.
Keywords: modelling; optimisation; hybridisation; sorting algorithms; comparative study.
DOI: 10.1504/IJCAST.2026.155957
International Journal of Complexity in Applied Science and Technology, 2026 Vol.2 No.3, pp.271 - 301
Received: 09 May 2025
Accepted: 14 Jul 2025
Published online: 27 Aug 2026 *