sort

package
v0.0.0-...-be291eb Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 4, 2022 License: MIT Imports: 0 Imported by: 0

Documentation

Overview

Package sort provides primitives for sorting slices of A.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func IsSorted

func IsSorted(data []A) bool

IsSorted reports whether data is sorted.

func Less

func Less(a A, b A) bool

Less is a function to compare two As

func Sort

func Sort(data []A)

Sort sorts data. It makes one call to data.Len to determine n, and O(n*log(n)) calls to data.Less and data.swap. The sort is not guaranteed to be stable.

Types

type A

type A int

An A is the element in the slice []A we are sorting

template type Sort(A, Less)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL