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!


Welcome to the new platform of Programmer's Heaven! We apologize for the inconvenience caused, if you visited us from a broken link of the previous version. The main reason to move to a new platform is to provide more effective and collaborative experience to you all. Please feel free to experience the new platform and use its exciting features. Contact us for any issue that you need to get clarified. We are more than happy to help you.

Permutation Algorithm help

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

makePermutations(permutation) {

if (length permutation < required length) {
for (i = min digit to max digit) {
if (i not in permutation) {
} else {
add permutation to list

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.