Skip to content

Glossary: Data Structures and Algorithms in Go

slices.SortFunc

Also written: SortFunc, SortStableFunc, slices.SortStableFunc, sort.Slice, sort.SliceStable

Functions that sort a slice in place using a comparison function you supply. The `Stable` versions keep equal items in their original order; plain `SortFunc` may not.

Where the book teaches it

Related terms

Comparison functionStable sortFunction literal