Sorting Algorithms in Delphi

A frequently encountered task in programming is that of sorting a sequence of numeric values. Typically, the sequence is provided in the form of an array of values. The download at the bottom of this page provides efficient Delphi implementations for the following sorting algorithms

The Best Sorting Algorithm

Developers often spend a great deal of time in an effort to implement the "best" sorting algorithm. By and large such efforts are misguided and pointless. Except for a small number of truly number intensive applications the efficiency of the occasional sort will have no impact on the perceived speed of the application. Even the lowly bubble sort will do a perfectly good job. It is better to spend development time exploring one or more of the following ideas

Much has been written on the subject of sorting. Generally speaking the efficiency of a sorting algorithm is judged based on the relationship between the size of the data sequence, n and the time required for the sort. The sorting algorithms described here belong to two categories

Needless to say this measure of efficiency does not fully account for the costs incurred by deep recursion, the excessive use of local variables etc. An excellent discussion of sorting algorithms can be found here.

Download
Jump To...

Colophon