sort

package
v0.0.0-...-211c7f1 Latest Latest
Warning

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

Go to latest
Published: Dec 18, 2019 License: Apache-2.0 Imports: 0 Imported by: 0

Documentation

Overview

Copyright 2009 The Go Authors. All rights reserved. Use of this source code is governed by a BSD-style license that can be found in the LICENSE file. Sorting using a general interface

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Float64sAreSorted

func Float64sAreSorted(a []float64) bool

func IntsAreSorted

func IntsAreSorted(a []int) bool

func IsSorted

func IsSorted(data Interface) bool

Test if data is sorted

func Sort

func Sort(data Interface)

General sort function

func SortFloat64s

func SortFloat64s(a []float64)

func SortInts

func SortInts(a []int)

Convenience wrappers for common cases

func SortStrings

func SortStrings(a []string)

func StringsAreSorted

func StringsAreSorted(a []string) bool

Types

type Float64Array

type Float64Array []float64

func (Float64Array) Len

func (p Float64Array) Len() int

func (Float64Array) Less

func (p Float64Array) Less(i, j int) bool

func (Float64Array) Swap

func (p Float64Array) Swap(i, j int)

type IntArray

type IntArray []int

Convenience types for common cases: IntArray

func (IntArray) Len

func (p IntArray) Len() int

func (IntArray) Less

func (p IntArray) Less(i, j int) bool

func (IntArray) Swap

func (p IntArray) Swap(i, j int)

type Interface

type Interface interface {
	Len() int
	Less(i, j int) bool
	Swap(i, j int)
}

Sorting interface

type StringArray

type StringArray []string

func (StringArray) Len

func (p StringArray) Len() int

func (StringArray) Less

func (p StringArray) Less(i, j int) bool

func (StringArray) Swap

func (p StringArray) Swap(i, j int)

Jump to

Keyboard shortcuts

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