Generic permutation library
Go to file
Evan Burkey 5d0edba2b0 git repo update 2022-11-03 07:57:15 -07:00
.gitignore init 2022-01-21 13:12:47 -08:00
LICENSE init 2022-01-21 13:12:47 -08:00
README.md github migration 2022-06-02 14:01:45 -07:00
go.mod git repo update 2022-11-03 07:57:15 -07:00
go.sum add PermutationsAllSizes 2022-11-03 07:54:02 -07:00
permutation.go add PermutationsAllSizes 2022-11-03 07:54:02 -07:00
permutation_test.go add PermutationsAllSizes 2022-11-03 07:54:02 -07:00

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]