Permutation Algorithm help - Programmers Heaven

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Categories

Permutation Algorithm help

gbminnockgbminnock Posts: 1Member
Hi all, I want to implement a permutation algorithm. And I have this pseudocode

[code]
makePermutations(permutation) {

if (length permutation < required length) {
for (i = min digit to max digit) {
if (i not in permutation) {
makePermutations(permutation+i)
}
}
} else {
add permutation to list
}
}
[/code]

This is a little vague to me, so if someone could help.
What is being passed into the fuction? Permutation is that a number?
And then makePermutations(permutaion +i) - what is that doing? Recursively calling the same function with an integer?

Thanks guys.



Sign In or Register to comment.