Generic permutation library
Go to file
Evan Burkey 2ccc3f8af5 Add documentation 2022-01-25 13:43:10 -08:00
.gitignore init 2022-01-21 13:12:47 -08:00
LICENSE init 2022-01-21 13:12:47 -08:00
README.md init 2022-01-21 13:12:47 -08:00
go.mod init 2022-01-21 13:12:47 -08:00
permutation.go Add documentation 2022-01-25 13:43:10 -08:00
permutation_test.go init 2022-01-21 13:12:47 -08:00

README.md

permutation

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

Install

go get git.fputs.com/fputs/permutation

Usage

package main

import (
	"fmt"

	perm "git.fputs.com/fputs/permutation"
)

func main() {
	a := []int{1, 2, 3, 4}
	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]