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 arrayarr
into ascending order according to the comparison functioncmp
. val sorted : ('a * 'a -> order) -> 'a array -> bool
-
sorted cmp arr
returns true if, and only if, the arrayarr=
is sorted in ascending order.