0

Possible Duplicate:
Listing all permutations of a string/integer

I need to know an efficient algorithm to obtain the permutations from 1 to a given number n, for example if the given number is 3, obtain 123, 132, 312, 321, 231, 213 and so on with any number n up to 200. Thanks in advance for any help you can provide.

Community
  • 1
  • 1
Ignacio Pochart
  • 137
  • 3
  • 13
  • Politeness would be great, by the way. – Etienne de Martel Jun 27 '11 at 15:23
  • the homework is to solve an ACM problem from pekin university online judge, I asked for a know algorithm that can help me do the stated problem. – Ignacio Pochart Jun 27 '11 at 15:28
  • 4
    There are 788657867364790503552363213932185062295135977687173263294742533244359449963403342920304284011984623904177212138919638830257642790242637105061926624952829931113462857270763317237396988943922445621451664240254033291864131227428294853277524242407573903240321257405579568660226031904170324062351700858796178922222789623703897374720000000000000000000000000000000000000000000000000 permutations of 200-element set. You want them all? – sdcvvc Jun 27 '11 at 15:28
  • 3
    For a 200-digit number to get all the permutations, you might struggle to find an algorithm that completes its execution, before you complete yours. – Orbling Jun 27 '11 at 15:32

0 Answers0