sorts

package
v1.0.19 Latest Latest
Warning

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

Go to latest
Published: Jul 14, 2023 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Examples

Constants

This section is empty.

Variables

This section is empty.

Functions

func Ordered

func Ordered[O constraints.Ordered](elems []O)
Example

ExampleOrdered is an example function.

package main

import (
	"fmt"

	"github.com/xuender/kit/sorts"
)

func main() {
	ints := []int{2, 1, 5, 4, 3}
	sorts.Ordered(ints)
	fmt.Println(ints)

	uint32s := []uint32{2, 1, 5, 4, 3}
	sorts.Ordered(uint32s)
	fmt.Println(uint32s)

	floats := []float32{2.2, 1.1, 5.5, 4.4, 3.3}
	sorts.Ordered(floats)
	fmt.Println(floats)
}
Output:

[1 2 3 4 5]
[1 2 3 4 5]
[1.1 2.2 3.3 4.4 5.5]

Types

This section is empty.

Jump to

Keyboard shortcuts

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