Permutation library using Go 1.18's generics
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
Evan Burkey 6606949d6d git repo update 1 month ago
.gitignore init 11 months ago
LICENSE init 11 months ago
README.md github migration 6 months ago
go.mod git repo update 1 month ago
go.sum add PermutationsAllSizes 1 month ago
permutation.go add PermutationsAllSizes 1 month ago
permutation_test.go add PermutationsAllSizes 1 month ago

README.md

permutation

A simple permutation package using generics. Requires go1.18 or higher

Install

go get github.com/fputs/permutation@latest

Usage

package main

import (
	"fmt"

	perm "github.com/fputs/permutation"
)

func main() {
	a := []int{1, 2, 3}
	p := perm.Permutations(a)
	fmt.Println(p)
}

result:

[1 2 3]
[2 1 3]
[3 1 2]
[1 3 2]
[2 3 1]
[3 2 1]