Generic permutation library
Go to file
Evan Burkey 831f490cfe Update README.md 2022-04-28 13:44:11 -07:00
.gitignore init 2022-01-21 13:12:47 -08:00
LICENSE init 2022-01-21 13:12:47 -08:00
README.md Update README.md 2022-04-28 13:44:11 -07: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.18 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}
	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]