Lotus Domino script snippet: Quicksort algorithm

Lotus Domino script snippet: Simple Quicksort algorithm

Algorithm can sort in both ascending and descending order.

Main function that can be called with an array any type that has a natural sort order. If boolean argument is true the array will be sorted in ascending order, otherwise it will be sorted in descending order.

Worker function that does the recursive sorting of the Quicksort algorithm
Function that does the actual comparing of values.