This problem isn't carefully defined. If you have 3,4,2 then 2 is the first value smaller and of higher index than both 3 and 4. So which to swap with?
On Mar 24, 10:01 am, Navin Kumar <[email protected]> wrote: > Given an array of integers, for each index i, you have to swap the value at > i with the first value smaller than A[ i ] that comes after index i. > An efficient solution expected. -- 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.
