Comparative Analysis of Sorting Algorithms: TimSort Python and Classical Sorting Methods
The sorted() function within the Python programming language has emerged as the primary choice among developers for sorting operations. Consequently, this study offers a comparative analysis of various classical sorting algorithms and Python's built-in sorting mechanisms, with the objective of...
Saved in:
| Published in | JISA (Jurnal Informatika dan Sains) Vol. 7; no. 1; pp. 11 - 18 |
|---|---|
| Main Authors | , |
| Format | Journal Article |
| Language | English |
| Published |
Program Studi Teknik Informatika Universitas Trilogi
27.06.2024
|
| Subjects | |
| Online Access | Get full text |
| ISSN | 2776-3234 2614-8404 2614-8404 |
| DOI | 10.31326/jisa.v7i1.1785 |
Cover
| Summary: | The sorted() function within the Python programming language has emerged as the primary choice among developers for sorting operations. Consequently, this study offers a comparative analysis of various classical sorting algorithms and Python's built-in sorting mechanisms, with the objective of identifying the most time-efficient sorting algorithm. The analysis involves assessing the time complexity of each algorithm while handling data arrays ranging from 10 to 1,000,000 elements using Python. These arrays are populated with randomly generated numeric values falling within the range of 1 to 1000. The benchmark algorithms utilized encompass Heap Sort, Shell Sort, Quick Sort, and Merge Sort. A looping mechanism is applied to each algorithm, and their execution speeds are gauged utilizing the Python 'time.perf_counter()' library. The findings of this study collectively indicate that Python's standard algorithm, surpasses classic sorting algorithms, including Heapsort, Shellsort, Quicksort, and Mergesort, in terms of execution. |
|---|---|
| ISSN: | 2776-3234 2614-8404 2614-8404 |
| DOI: | 10.31326/jisa.v7i1.1785 |