sort

package
v0.0.0-...-f6453c5 Latest Latest
Warning

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

Go to latest
Published: Jul 8, 2020 License: MIT Imports: 0 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BubbleSort

func BubbleSort(data Interface)

func BubbleSort1

func BubbleSort1(data Interface)

优化:避免无效循环

func HeapSort

func HeapSort(data Interface)

func InsertSort

func InsertSort(data Interface)

func InsertSort1

func InsertSort1(data []int)

优化:减少交换

func MergeSort

func MergeSort(data []int)

func QuickSort

func QuickSort(data []int)

func QuickSort1

func QuickSort1(data []int)

func SelectSort

func SelectSort(data Interface)

func ShellSort

func ShellSort(data []int)

func ShellSort1

func ShellSort1(data []int)

Types

type Float64Slice

type Float64Slice []float64

func (Float64Slice) HeapSort

func (p Float64Slice) HeapSort()

func (Float64Slice) Len

func (p Float64Slice) Len() int

func (Float64Slice) Less

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

func (Float64Slice) Swap

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

type IntSlice

type IntSlice []int

func (IntSlice) HeapSort

func (p IntSlice) HeapSort()

func (IntSlice) Len

func (p IntSlice) Len() int

func (IntSlice) Less

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

func (IntSlice) Swap

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

type Interface

type Interface interface {
	// Len is the number of elements in the collection.
	Len() int
	// Less reports whether the element with
	// index i should sort before the element with index j.
	Less(i, j int) bool
	// Swap swaps the elements with indexes i and j.
	Swap(i, j int)
}

type StringSlice

type StringSlice []string

func (StringSlice) HeapSort

func (p StringSlice) HeapSort()

func (StringSlice) Len

func (p StringSlice) Len() int

func (StringSlice) Less

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

func (StringSlice) Swap

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

Jump to

Keyboard shortcuts

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