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.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func IntsAreSorted

func IntsAreSorted(a []int) bool

func IsSorted

func IsSorted(data Sorter) bool

func Sort

func Sort(data Sorter)

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 IntArray

type IntArray []int

Convenience types for common cases

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 Sorter

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

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