IDEAS home Printed from https://ideas.repec.org/a/ids/ijcast/v2y2026i3p271-301.html

A comprehensive analysis of classical sorting algorithms with diverse input conditions

Author

Listed:
  • Mohsen Mohammadagha

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.

Suggested Citation

  • Mohsen Mohammadagha, 2026. "A comprehensive analysis of classical sorting algorithms with diverse input conditions," International Journal of Complexity in Applied Science and Technology, Inderscience Enterprises Ltd, vol. 2(3), pages 271-301.
  • Handle: RePEc:ids:ijcast:v:2:y:2026:i:3:p:271-301
    as

    Download full text from publisher

    File URL: https://www.inderscience.com/link.php?id=155957
    Download Restriction: Access to full text is restricted to subscribers.
    ---><---

    As the access to this document is restricted, you may want to

    for a different version of it.

    More about this item

    Keywords

    ;
    ;
    ;
    ;
    ;

    Statistics

    Access and download statistics

    Corrections

    All material on this site has been provided by the respective publishers and authors. You can help correct errors and omissions. When requesting a correction, please mention this item's handle: RePEc:ids:ijcast:v:2:y:2026:i:3:p:271-301. See general information about how to correct material in RePEc.

    If you have authored this item and are not yet registered with RePEc, we encourage you to do it here. This allows to link your profile to this item. It also allows you to accept potential citations to this item that we are uncertain about.

    We have no bibliographic references for this item. You can help adding them by using this form .

    If you know of missing items citing this one, you can help us creating those links by adding the relevant references in the same way as above, for each refering item. If you are a registered author of this item, you may also want to check the "citations" tab in your RePEc Author Service profile, as there may be some citations waiting for confirmation.

    For technical questions regarding this item, or to correct its authors, title, abstract, bibliographic or download information, contact: Sarah Parker (email available below). General contact details of provider: http://www.inderscience.com/browse/index.php?journalID=71 .

    Please note that corrections may take a couple of weeks to filter through the various RePEc services.

    IDEAS is a RePEc service. RePEc uses bibliographic data supplied by the respective publishers.