Sorting algorithms/Quicksort: Difference between revisions

No edit summary
Line 3,745:
{{works with|Delphi|6.0}}
{{libheader|SysUtils,StdCtrls}}
This quick sort routine is infinitely versatile. It sorts an array of pointers. The advantage of this is that pointers can contain anything, ranging from integers, to strings, to floating point numbers to objects. The way each pointer is interpreted is through the compare routine, which is customized for the particular situation. The compare routine can interpret each pointer as a string, an integer, a float or an object and it can treat those items in different ways. For example, the order in which it compares strings controls wetherwhether the sort is alphabetical or reverse alphabetical. In this case, I show an integer sort, an alphabetic string sort, a reverse alphbeticalalphabetical string sort and a string sort by length.
 
<syntaxhighlight lang="Delphi">
Line 3,916:
 
</pre>
 
 
=={{header|Dart}}==
465

edits