The ArrayQSortFn
functor provides in situ sorting of monomorphic arrays
using the quicksort algorithm.
Synopsis
signature MONO_ARRAY_SORT
functor ArrayQSortFn (A : MONO_ARRAY) : MONO_ARRAY_SORT
Functor Argument Interface
A : MONO_ARRAY
Functor Argument Description
A : MONO_ARRAY
-
A structure that implements the
MONO_ARRAY
signature from the SML Basis Library.
Interface
structure A : MONO_ARRAY
val sort : (A.elem * A.elem -> order) -> A.array -> unit
val sorted : (A.elem * A.elem -> order) -> A.array -> bool
Interface Description
structure A : MONO_ARRAY
-
The argument structure.
val sort : (A.elem * A.elem -> order) -> A.array -> unit
-
sort cmp arr
sorts the arrayarr
into ascending order according to the comparison functioncmp
. val sorted : (A.elem * A.elem -> order) -> A.array -> bool
-
sorted cmp arr
returns true if, and only if, the arrayarr=
is sorted in ascending order.