@Yogesh Yadav algo geek's approach is correct. With your number 759845. When you start moving left from right most integer, you stop when the numbers are no longer in increasing order, in this case you stop at first integer i.e, at 5 and swap with 4. Which gives exactly same correct answer as you have mentioned.
On Fri, Sep 23, 2011 at 8:36 AM, Abhishek Goswami <[email protected]>wrote: > I have seen code and output but I think it should be 7965 am i right? if > you are looking for first largest > > > On Thu, Sep 22, 2011 at 12:46 AM, Anil Arya <[email protected]> wrote: > >> http://ideone.com/pmil8 >> >> >> On Thu, Sep 22, 2011 at 12:46 AM, Anil Arya <[email protected]>wrote: >> >>> @kartik >>> Is it right >>> >>> >>> On Wed, Sep 21, 2011 at 10:24 PM, kartik sachan <[email protected] >>> > wrote: >>> >>>> obivously it will be first largest ........ >>>> >>>> -- >>>> You received this message because you are subscribed to the Google >>>> Groups "Algorithm Geeks" group. >>>> To post to this group, send email to [email protected]. >>>> To unsubscribe from this group, send email to >>>> [email protected]. >>>> For more options, visit this group at >>>> http://groups.google.com/group/algogeeks?hl=en. >>>> >>> >>> >>> >>> -- >>> *Anil Arya, >>> Computer Science * >>> *Motilal Nehru National Institute of Technology,Allahabad . >>> * >>> >>> >>> >> >> >> -- >> *Anil Arya, >> Computer Science * >> *Motilal Nehru National Institute of Technology,Allahabad . >> * >> >> >> -- >> You received this message because you are subscribed to the Google Groups >> "Algorithm Geeks" group. >> To post to this group, send email to [email protected]. >> To unsubscribe from this group, send email to >> [email protected]. >> For more options, visit this group at >> http://groups.google.com/group/algogeeks?hl=en. >> > > -- > You received this message because you are subscribed to the Google Groups > "Algorithm Geeks" group. > To post to this group, send email to [email protected]. > To unsubscribe from this group, send email to > [email protected]. > For more options, visit this group at > http://groups.google.com/group/algogeeks?hl=en. > -- You received this message because you are subscribed to the Google Groups "Algorithm Geeks" group. To post to this group, send email to [email protected]. To unsubscribe from this group, send email to [email protected]. For more options, visit this group at http://groups.google.com/group/algogeeks?hl=en.
