STFC Website

part of UK Research & Innovation

Version 1.0.0

12th July 2004

KB08: Sort numbers into descending order with indexing using Quicksort

To sort an array of numbers into descending order maintaining an index array to preserve a record of the original order. The quicksort algorithm is used.