Conference Paper
2026

Cross-Language Evaluation of Sorting Algorithms on Various Input Patterns: A Comparative Study

Authors
Shah Rafatur Rahman
Abstract
Sorting algorithms are essential in computing applications, yet their practical performance varies across programming languages and input data structures. Existing studies often focus on single-language implementations or limited datasets, leaving a gap in understanding cross-language behavior under diverse input patterns. This study presents a comparative evaluation of six sorting algorithms—Bubble, Heap, Insertion, Merge, Quick, and Selection Sort—implemented in C, C++, Go, Java, PHP, and Python. Experiments were conducted using identical arrays of 100,000 elements across six input patterns, including ascending, descending, nearly sorted, random, duplicates, and repeated patterns. Execution times were analyzed using the Coefficient of Variation (CV), Relative Slowdown Factor (RSF), and Pattern Sensitivity Coefficient (PSC). The results show that programming language environment has a dominant influence on execution efficiency. C and C++ deliver the fastest performance, followed by Go and Java, while PHP and Python exhibit substantially higher runtimes due to interpreter and runtime overhead. Among algorithms, Heap Sort and Merge Sort provide the most consistent performance across input patterns, whereas Quick Sort performs best on random data but shows sensitivity to ordered inputs. Insertion Sort is highly efficient for nearly sorted arrays but exhibits large performance variation, while Bubble and Selection Sort remain inefficient across all environments. The most effective performance is achieved when robust algorithms are paired with low-overhead languages, particularly Heap Sort and Merge Sort in C and C++. The empirical findings are further supported by theoretical bounds derived from decision-tree complexity and factorial approximations, providing mathematical grounding for observed performance trends. This study provides a structured cross-language benchmarking framework and practical guidance for selecting efficient sorting strategies in real-world computing environments.
Publication Details
Published In:
Journal of Computer Languages
Publication Year:
2026
Publication Date:
April 2026
Type:
Conference Paper
Total Authors:
1