question: changing order

V

VikingHun

Hi all;)

I recently thought about making a program that would output all
possible
orders that groups of numbers, characters etc. of different sizes
could have.(eg. 1,2,3 1,3,2 2,1,3 2,3,1 3,1,2 3,2,1) I racked my
brain, but couldn't find a solution. Can anyone help me?
 
I

Ioannis Vranos

VikingHun said:
Hi all;)

I recently thought about making a program that would output all
possible
orders that groups of numbers, characters etc. of different sizes
could have.(eg. 1,2,3 1,3,2 2,1,3 2,3,1 3,1,2 3,2,1) I racked my
brain, but couldn't find a solution. Can anyone help me?


Check std::next_permutation, std::prev_permutation.
 
M

Malte Starostik

VikingHun said:
Hi all;)

I recently thought about making a program that would output all
possible
orders that groups of numbers, characters etc. of different sizes
could have.(eg. 1,2,3 1,3,2 2,1,3 2,3,1 3,1,2 3,2,1) I racked my
brain, but couldn't find a solution. Can anyone help me?

Have you tried std::next_permutation or std::prev_permutation?

Cheers,
Malte
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,764
Messages
2,569,564
Members
45,041
Latest member
RomeoFarnh

Latest Threads

Top