| | |
Enumerating permutations
Please support our Java advertiser: Programming Forums - DaniWeb Sister Site
![]() |
•
•
Join Date: Mar 2008
Posts: 31
Reputation:
Solved Threads: 0
HI all
Can anyone help me with this algorithm (I ned to write the code in java)......The java code would also be helpful
Describe a recursive algorithm for enumerating all permutations of the numbers {1,2,...,n}.
I'd appriciate it if somebody could explain this problem to me and give me some idea on how i can get started
Many Thanks
Can anyone help me with this algorithm (I ned to write the code in java)......The java code would also be helpful
Describe a recursive algorithm for enumerating all permutations of the numbers {1,2,...,n}.
I'd appriciate it if somebody could explain this problem to me and give me some idea on how i can get started
Many Thanks
Have you understood the question yourself ? What do you mean by this:
I don't think so, with the way you have copy-pasted the assignment-looking statement. If you haven't understood the question in the first place you cannot even begin with thinking how to answer it. So if you understand that, you yourself would gain a slight insight into what should be done to solve it.
•
•
•
•
Describe a recursive algorithm for enumerating all permutations of the numbers {1,2,...,n}
Last edited by verruckt24; Mar 13th, 2009 at 1:35 pm.
Get up every morning and take a look at the Forbes' list of richest people. If your name doesn't appear.... GET TO WORK !!!
•
•
Join Date: Mar 2008
Posts: 31
Reputation:
Solved Threads: 0
Thanks a lot!
If i didn't know anything 'bout the question, i wouldn't have had posted it!
I know htat for n elements, there are n! possible permutations
And I think that the procedure should be something like this:
(to make it recursive) enumerate the permutatipons of n-1 in each
time that the recursive algorithm is called
It doesn't matter if you or no one else doesn't share any ideas
I've always come up with solutions of my own
oh...and for the copy-paste thing...I just wanted to make sure I state my problem clearly
thanks anyway
If i didn't know anything 'bout the question, i wouldn't have had posted it!
I know htat for n elements, there are n! possible permutations
And I think that the procedure should be something like this:
(to make it recursive) enumerate the permutatipons of n-1 in each
time that the recursive algorithm is called
It doesn't matter if you or no one else doesn't share any ideas
I've always come up with solutions of my own
oh...and for the copy-paste thing...I just wanted to make sure I state my problem clearly
thanks anyway
Firstly, there's no need to be so heated up for nothing you can save your energies for your solution finding activity. I wasn't trying to be rude or mean even. All I wanted to make sure was that you understand the problem well, which I did not think you had. Since your understanding of the problem is very important for your answer to be in the right direction otherwise you cannot expect that to happen.
And to answer some of your questions:
>If i didn't know anything 'bout the question, i wouldn't have had posted it!
You don't know thats the reason you have posted the question and posted
how you'd go about solving it. Don't try to show-off now that you knew so much.
And if you know so much :
>I know htat for n elements, there are n! possible permutations
>And I think that the procedure should be something like this:
>(to make it recursive) enumerate the permutatipons of n-1 in each
>time that the recursive algorithm is calle
Then why haven't you already started working on it with whatever you know of it ? Where's the code to show us your effort. All this knowledge yet no code to post means, quite straightforwardly, no effort put in till yet.
>It doesn't matter if you or no one else doesn't share any ideas
>I've always come up with solutions of my own
Hmm... Why would somebody like you then start a thread asking for help and solutions of others, in the first place.
And to answer some of your questions:
>If i didn't know anything 'bout the question, i wouldn't have had posted it!
You don't know thats the reason you have posted the question and posted
how you'd go about solving it. Don't try to show-off now that you knew so much.
And if you know so much :
>I know htat for n elements, there are n! possible permutations
>And I think that the procedure should be something like this:
>(to make it recursive) enumerate the permutatipons of n-1 in each
>time that the recursive algorithm is calle
Then why haven't you already started working on it with whatever you know of it ? Where's the code to show us your effort. All this knowledge yet no code to post means, quite straightforwardly, no effort put in till yet.
>It doesn't matter if you or no one else doesn't share any ideas
>I've always come up with solutions of my own
Hmm... Why would somebody like you then start a thread asking for help and solutions of others, in the first place.
Last edited by verruckt24; Mar 13th, 2009 at 2:53 pm.
Get up every morning and take a look at the Forbes' list of richest people. If your name doesn't appear.... GET TO WORK !!!
![]() |
Other Threads in the Java Forum
- Previous Thread: Installtion problem of MySql JDBC driver JConnector 5.0
- Next Thread: Why doesn't this code delete a file? Help me troubleshoot
| Thread Tools | Search this Thread |
-xlint add android api applet application array arrays automation bi binary blackberry bluetooth chat class classes client code compile compiler component converter database digit eclipse equation error event exception fractal freeze functiontesting game gameprogramming givemetehcodez graphics gui health html hyper ide idea image input int integer j2me java javame javaprojects jetbrains jni jpanel jtable julia learningresources linux list login loop main map method methods mobile myregfun netbeans newbie nonstatic notdisplaying oracle page pearl print problem program programming project qt recursion scanner screen scrollbar server set size sms sort spamblocker sql string swing system thread threads time tree variablebinding windows xor





