sort

package
Version: v0.0.0-...-39373db Latest Latest
Warning

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

Go to latest
Published: Jan 18, 2021 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)

Source Files

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
t or T : Toggle theme light dark auto
y or Y : Canonical URL