A Comparative Study of Sorting Algorithms Based on Time Complexity and Runtime
Year: 2026
Type: preprint
Abstract: This study presents a comparative performance analysis of six fundamental sorting algorithms: Bubble Sort, Selection Sort, Insertion Sort, Merge Sort, Quick Sort, and Heap Sort. The algorithms were implemented in Python and evaluated using different input sizes ranging from 1,000 to 20,000 elements. Three types of datasets were considered: random, already sorted, and reverse-sorted data. Execution time was measured using Python's time.perf_counter() function, and the average runtime was calculated over three trials. The experimental results demonstrate how theoretical time complexity relates to practical execution performance. Quick Sort performed particularly well on random datasets but experienced significant slowdown on sorted and reverse-sorted inputs due to its fixed pivot selection. Insertion Sort performed efficiently on already sorted datasets. The study highlights the importance of input characteristics when selecting an appropriate sorting algorithm.
Author: Ayush
Language: English
Subfield: Theoretical Computer Science
Field: Mathematics
Domain: Physical Sciences
Open Access status: green
OpenAlex ID: W7233558952
Cites:
Cited by:
Related to:
