will it be given that the number of elements is always even??

On 5/28/11, ross <jagadish1...@gmail.com> wrote:
> Hi all,
>
> Sort all elements in odd indices of an array in ascending order and
> even indices in descending order.
> Finally, rearrange so that all even indexed elements come first.
>
> eg:
>
> input – 7 2 6 4 8 3 1
>
> even indexed : 7 6 8 1 => sort 8 7 6 1
> odd indexed: 2 4 3 => sort 2 3 4
>
> output – 8 7 6 1 2 3 4
>
> What could be the best algo to solve it?
> Is it possible to arrive at the output using only O(1) extra space?
>
> --
> 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
> algogeeks+unsubscr...@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/algogeeks?hl=en.
>
>


-- 
*Piyush Sinha*
*IIIT, Allahabad*
*+91-8792136657*
*+91-7483122727*
*https://www.facebook.com/profile.php?id=100000655377926 *

-- 
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 
algogeeks+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/algogeeks?hl=en.

Reply via email to