if the array considered is { 1 ,6 ,8 ,3 ,5, 4, 2} is this the way the
problm o/p expected???
1 6 8 3 5 4 2
1 3 8 6 5 4 2
1 3 6 8 5 4 2
1 3 6 5 8 4 2
1 3 6 5 4 8 2
1 3 6 5 4 2 8
correct if wrong.....
On Sat, Mar 24, 2012 at 10:53 PM, karthikeyan muthu <
[email protected]> wrote:
> if i'm not wrong .. we are to repeat this process till no more such pair
> is found.. rite?? this condition will come only if the given array gets
> sorted in ascending order .. so the solution is to sort the array
> O(nlogn)..
>
>
>
> On Sat, Mar 24, 2012 at 7:31 PM, 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 view this discussion on the web visit
>> https://groups.google.com/d/msg/algogeeks/-/an6YzWV-2xsJ.
>> 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.