sort

package
v0.1.3 Latest Latest
Warning

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

Go to latest
Published: Sep 12, 2024 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func MapSort

func MapSort[T constraints.Ordered, V any](m map[T]V, order SortOrder) <-chan T

func SortMap

func SortMap[T constraints.Ordered, V Number](m map[T]V) []T

func SortSlice

func SortSlice[T constraints.Ordered](s []T, order SortOrder)

Types

type Number

type Number interface {
	int | int64 | float32 | float64
}

type Pair

type Pair[T constraints.Ordered, V Number] struct {
	// contains filtered or unexported fields
}

type SortOrder

type SortOrder bool
const (
	Descending SortOrder = true
	Ascending  SortOrder = false
)

Jump to

Keyboard shortcuts

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