sort

package
v0.0.0-...-1f453bd Latest Latest
Warning

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

Go to latest
Published: Aug 17, 2023 License: Apache-2.0 Imports: 0 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BubbleSort

func BubbleSort[T Number](arr []T, isDesc ...bool)

BubbleSort 冒泡排序

arr 需要排序的slice
isDesc 是否倒序: true 是; false 否

Types

type Bubble

type Bubble[T Number] []T

Bubble 冒泡排序

func (Bubble[T]) RSort

func (b Bubble[T]) RSort()

RSort 排序: 倒序

func (Bubble[T]) Sort

func (b Bubble[T]) Sort()

Sort 排序: 正序

type Float

type Float interface {
	~float32 | ~float64
}

Float 浮点数

type Integer

type Integer interface {
	Signed | Unsigned
}

Integer 整数

type Number

type Number interface {
	Integer | Float
}

Number 数字

type Ordered

type Ordered interface {
	Number | ~string
}

Ordered 数字或字符串

type Signed

type Signed interface {
	~int | ~int8 | ~int16 | ~int32 | ~int64
}

Signed 有符合整数

type Unsigned

type Unsigned interface {
	~uint | ~uint8 | ~uint16 | ~uint32 | ~uint64 | ~uintptr
}

Unsigned 无符号整数

Jump to

Keyboard shortcuts

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