The ArrayQSort structure
Author: John Reppy
Keywords: Standard ML, SML, SML/NJ Library

The SML of NJ Library
The `ArrayQSort` structure

The `ArrayQSort` structure provides in situ sorting of polymorphic arrays using the quicksort algorithm.

## Synopsis

    signature ARRAY_SORT
    structure ArrayQSort : ARRAY_SORT

## Interface

    val sort   : ('a * 'a -> order) -> 'a array -> unit
    val sorted : ('a * 'a -> order) -> 'a array -> bool

## Description

`val sort : ('a * 'a -> order) -> 'a array -> unit`

  `sort cmp arr` sorts the array `arr` into ascending order according to the comparison function `cmp`.

`val sorted : ('a * 'a -> order) -> 'a array -> bool`

  `sorted cmp arr` returns true if, and only if, the array `arr=` is sorted in ascending order.

## See Also

`ArrayQSortFn`, The Util Library

SML/NJ Version 110.99.9 (November 4, 2025)
Last updated 2025-11-04 15:48:25 UTC