#### Archived

This topic is now archived and is closed to further replies.

# recursive permutations PLZ HELP

This topic is 5483 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

## Recommended Posts

Hello friends. This is my first post in GAMEDEV and I''m very excited. I have this HW in data-structures, which I have no bloody idea how to solve :> I have to find RECURSEVLY all the permutations (only one iteretive loop can be used in the program, and no additional strings can be used, only one for string input) F(JEDI)={EJDI, DIEJ, EJDI...} Thank''s in advance :>

##### Share on other sites
quote:
Original post by sega_boy
Hello friends.
This is my first post in GAMEDEV and I''m very excited.

I have this HW in data-structures, which I have no bloody idea how to solve :>

I have to find RECURSEVLY all the permutations (only one iteretive loop can be used in the program, and no additional strings can be used, only one for string input)

F(JEDI)={EJDI, DIEJ, EJDI...}

Refer to next line for solution
Refer to previous line.

##### Share on other sites
Hello, sega_boy.

I''m sorry that your first post here has to turn out this way, but remember that Gamedev is a web site to help game developers in creating games, so I doubt anyone here is willing to help you out with homework questions.

As the FAQ points out, this homework has been given out to you so you can understand and learn the inner workings of what you are studying, and if we were to help you, this would destroy the whole point of having homework to do.

Remember, make a man a fire and he''ll be warm for the rest of the day. Set a man on fire and he''ll be warm for the rest of his life (copyrighted by whoever I took this from, sry).

PS : you counted twice the permutation "EJDI".

##### Share on other sites
well, it''s quite simple. You need to find the recursive case, and the terminal case.

recursive case: pick a letter, and add it to the output. Recurse on the set of letters minus that one
Terminal case: we have no more letters to choose from!

##### Share on other sites
I found this homework independently on different forum and I already solved it (twice). If you want know the url: http://www.mikrogen.com/cz/phpbb2/viewtopic.php?t=153
I hope it is correct.

PS: This is my first post too.

1. 1
Rutin
49
2. 2
3. 3
4. 4
5. 5

• 10
• 28
• 20
• 9
• 20
• ### Forum Statistics

• Total Topics
633410
• Total Posts
3011723
• ### Who's Online (See full list)

There are no registered users currently online

×