Sorting efficiency remains crucial in modern computing, not only in execution time but also in memory usage, especially on resource-constrained systems. The Layered Sorting Algorithm (LSA) is claimed to reduce comparisons by partitioning data according to digit length, yet this claim has not been adequately tested on random numeric data whose digit-length distribution is naturally skewed. This study compares the time and memory efficiency of LSA-QuickSort with Quick Sort, Merge Sort, Shell Sort, and Counting Sort. All five algorithms were implemented in Java and evaluated on three random dataset scenarios of 1,000, 10,000, and 100,000 elements with maximum digit lengths of 4, 6, and 8. Each combination was executed three times and averaged in nanoseconds and bytes. The results show that LSA-QuickSort is not more efficient than the baseline algorithms on random data. In scenario C, its runtime reached 30,588,333 nanoseconds, almost twice that of Quick Sort (16,605,333 nanoseconds), while its memory usage was 2,584,221 bytes. Counting Sort suffered a memory explosion of 401,409,917 bytes. These findings confirm that layering becomes overhead on random data. Practitioners are therefore advised to use Quick Sort for general cases, whereas LSA is potentially useful only when digit lengths are evenly distributed.
Copyrights © 2026