Which sorting algorithms to choose for hard real-time applications
D. Mittermair, Peter P. Puschner · 2002
This paper compares the worst-case performance of eight standard sorting algorithms. It investigates how well-suited these algorithms are for hard real-time systems. In a series of experiments, we determined the average and worst-case execution times of the sorting algorithms for different numbers of elements to be sorted (in the range between 7 and 1000 elements). Average times were extracted from test runs with random data, whereas the worst-case times were determined both analytically with an analysis tool and experimentally by construction of the worst-case input data for each algorithm. The experiments demonstrate that algorithms that are well-suited for normal needs are not necessarily suited for hard real-time systems. Thus, the results help to choose the right sorting algorithm for real-time applications.