working on making permutations now...

This commit is contained in:
alexchao26
2020-01-05 11:32:19 -05:00
parent d969c00c97
commit 58bd197281
3 changed files with 282 additions and 0 deletions
+26
View File
@@ -0,0 +1,26 @@
package permutations
// CreatePermutations will return a 2D slice containing permutations from zero to the inputted int
func CreatePermutations(size int) []string {
result := make([]string, 0)
pointerToResult := &result
onePerm(pointerToResult, "01234")
return result
}
func onePerm(resultSlice *[]string, substring string) {
// if len(*resultSlice) == 0 {
// for i := 0; i < len(substring); i++ {
// *resultSlice = append(*resultSlice, string(substring[i]))
// }
// return
// }
// for i := 0; i < len(*resultSlice); i++ {
// newSubstring := *resultSlice[i]
// }
// modify the actual data @ the location in memory
// fmt.Println(resultSlice, *resultSlice)
}