Creating Permutations

Post any maths and/or physics related questions here.

Moderators: Darobat, RecursiveS, Dante Shamest, Bugdude, Wizard

Creating Permutations

Postby Pests » Mon Feb 28, 2005 10:21 pm

When giving a list of characters or numbers whats the best way to generate each possible permutation of those characters / numbers? I've tried a few things but keep on having problems with not reusing letters and numbers, and even more problems when the same letter/number appears more then once.
Pests
 
Posts: 52
Joined: Thu Dec 11, 2003 5:28 pm

Postby Bugdude » Mon Feb 28, 2005 10:29 pm

You can try std::next_permutation() from <algorithm>.
User avatar
Bugdude
Moderator
 
Posts: 2480
Joined: Sun Aug 29, 2004 1:58 am
Location: Living in sin


Return to Maths & Physics

Who is online

Users browsing this forum: No registered users and 0 guests