A Data-Sensitive Time Complexity Analysis of Sorting Algorithms on Real-Life Data
Manoj Ughade *
Department of Mathematics, Institute for Excellence in Higher Education, Bhopal, India.
Neha Warathe
Department of Mathematics, Institute for Excellence in Higher Education, Bhopal, India.
*Author to whom correspondence should be addressed.
Abstract
This study presents a comprehensive analysis of the performance of classical sorting algorithms on real-life datasets by integrating theoretical and empirical approaches within a data-sensitive framework. Unlike conventional analyses based solely on asymptotic complexity, this work introduces a data-sensitive complexity model of the form T(n, D) = f(n) + g(D), explicitly incorporating dataset characteristics into performance evaluation, with inversion count k(D) serving as a key measure of disorder. Experimental results demonstrate that algorithm performance is strongly influenced by input data structure, where adaptive algorithms such as Insertion Sort achieve near-linear performance for nearly sorted datasets, consistent with T(n, D) = Θ(n + k(D)), while efficient divide-and conquer algorithms such as Quick Sort and Merge Sort exhibit stable Θ(n log n) behavior across varying input sizes. In contrast, quadratic-time algorithms remain inefficient due to their limited sensitivity to favorable data structures. These findings highlight the limitations of purely theoretical models and emphasize the necessity of incorporating data-dependent factors for realistic
Keywords: Sorting algorithms, time complexity, data-sensitive analysis, empirical evaluation, real-life data