radix

package module
v1.0.1 Latest Latest
Warning

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

Go to latest
Published: Oct 18, 2023 License: MIT Imports: 6 Imported by: 0

README

radix

The radix package implements radix sorting, currently for all signed and unsigned integer slices, and string slices.

Usage:

package main

import (
	"fmt"

	"github.com/stuarthighley/radix"
)

func main() {
	ints := []int{74, 59, 238, -784, 9845, 959, 905, 0, 0, 42, 7586, -5467984, 7586}
	radix.SortInts(ints)
	fmt.Println(ints)

	data := []string{"", "Hello", "foo", "bar", "foo", "f00", "%*&^*&^&", "***"}
	radix.SortStrings(data)
	fmt.Println(data)
}

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func SortFloats added in v1.0.1

func SortFloats[F constraints.Float](input []F)

SortFloats sorts a slice of any float type in ascending order.

func SortInts

func SortInts[T constraints.Integer](input []T)

SortInts sorts a slice of any integer type in ascending order.

func SortStrings

func SortStrings[T ~string](input []T)

SortStrings sorts a slice of strings in ascending order.

Types

This section is empty.

Jump to

Keyboard shortcuts

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