Thread: INT ARRAY Permutation!

  1. #1
    Registered User
    Join Date
    Oct 2002

    INT ARRAY Permutation!

    Hi everyone

    I'm ultra newb.

    I looked through this board for permutation of numbers but everyone wanted permutation of characters and those seemed to be the example..

    I REALLY need some sample code to work on that can give me permutations of an int array, in my case 1-9. I would LOVE if someone could help me come up with an algorithm to do this or a way. I really don't want to use the STD or next_permutation, SIMPLE CODE please, that doesn't require memory allocation, or pointers. Nested loops, and recursive functions would be nice.

    THANKYOU VERY MUCH (in advance)


  2. #2
    Guest Sebastiani's Avatar
    Join Date
    Aug 2001
    Waterloo, Texas

    Post YOU ARE SOOOOO(!!!!!!) WELCOME!!!!!

    Now show some effort!
    #include <cmath>
    #include <complex>
    bool euler_flip(bool value)
        return std::pow
            std::complex<float>(0, 1) 
            * std::complex<float>(std::atan(1.0)
            *(1 << (value + 2)))
        ).real() < 0;

  3. #3
    Just a Member ammar's Avatar
    Join Date
    Jun 2002
    At least try starting it yourself, and when you are stuck just post what you have here.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Replies: 8
    Last Post: 03-10-2008, 11:57 AM
  2. Screwy Linker Error - VC2005
    By Tonto in forum C++ Programming
    Replies: 5
    Last Post: 06-19-2007, 02:39 PM
  3. Need help understanding info in a header file
    By hicpics in forum C Programming
    Replies: 8
    Last Post: 12-02-2005, 12:36 PM
  4. problem with sorting
    By pinkpenguin in forum C Programming
    Replies: 2
    Last Post: 11-18-2005, 11:06 AM
  5. Half-life SDK, where are the constants?
    By bennyandthejets in forum Game Programming
    Replies: 29
    Last Post: 08-25-2003, 11:58 AM