This should work

prev_permutation ( )

-Dhyanesh

On 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
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---

Reply via email to