have u written some pseudo-code function fo the problem as actually i could only c prev_permutation. Can u make it more clear.
On 2/26/06, Dhyanesh
<[EMAIL PROTECTED]> wrote:
This should work
prev_permutation ( )
-DhyaneshOn 2/26/06, Dont Know < [EMAIL PROTECTED] > wrote:
@daizi sheng
Thanks for Ur ideas. But in Ur solution how do u fix the prefix.
ie., How did U choose 112 as the prefix in the number 11261. Can
u pls provide the algo.
@Ajay
U are correct. for the first example I gave, I made a mistake.
So, I will define the problem again. Sorry for that. So the correct
requirement is
the algo should give the largest number possible, but smaller
than the given number with a constraint that the same combination
of digits are to be used. It is true that for some numbers this may
--
Ajay kr. Mishra
www.ajay.mishra19.googlepages.com
IIT KGP
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Algorithm Geeks" group.
To post to this group, send email to algogeeks@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at http://groups.google.com/group/algogeeks
-~----------~----~----~----~------~----~------~--~---