+ 1
I want to print the values of an array in every possible combination, how do I do that?
2 Antworten
+ 2
tim szarfenord
I don't know, but I would start here
https://stackoverflow.com/questions/4240080/generating-all-permutations-of-a-given-string
+ 2
I would try heaps algorithm or quickperm algorithm. Both explained here:
https://www.baeldung.com/cs/array-generate-all-permutations
Johnson-Trotter is also possible but not really beginner friendly 😉
https://code.sololearn.com/cz8eU44ocu26/?ref=app