Permutation algorithms...

This is a discussion on Permutation algorithms... within the C++ Programming forums, part of the General Programming Boards category; Greetings, everyone. I'm sure all of you know that we can obtain permutations of something using C++ STL's next_permutation() function. ...

  1. #1
    Registered User
    Join Date
    Nov 2006
    Location
    Coimbra, Portugal
    Posts
    64

    Permutation algorithms...

    Greetings, everyone. I'm sure all of you know that we can obtain permutations of something using C++ STL's next_permutation() function. However...

    There are cases in which we do need to obtain all permutations, but not necessarily in lexicographical order. So I thought: "If that's the case, then the next_permutation() function does more work than I really need it to".

    So here's the question I have to ask everyone: what is the most efficient non-lexicographical permutation algorithm?
    Last edited by Mr_Miguel; 07-20-2007 at 11:32 AM.
    Name: Miguel Martins
    Date of birth: 14th August 1987

    "He who hesitates is lost."

  2. #2
    Registered User
    Join Date
    Sep 2001
    Posts
    752
    This covers the subject pretty well, http://marknelson.us/2002/03/01/next-permutation
    Callou collei we'll code the way
    Of prime numbers and pings!

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Sorting algorithms, worst-case input
    By Leftos in forum C++ Programming
    Replies: 17
    Last Post: 06-15-2009, 02:33 PM
  2. bit level permutation function
    By zxcv in forum C Programming
    Replies: 2
    Last Post: 07-27-2008, 02:26 PM
  3. relative strength of encryption algorithms (blowfish, des, rinjdael...)
    By duck-billed platypus in forum A Brief History of Cprogramming.com
    Replies: 3
    Last Post: 12-30-2001, 04:20 PM
  4. Same question about algorithms in C
    By pritesh in forum C Programming
    Replies: 3
    Last Post: 11-17-2001, 10:45 PM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21