its possible
take gn array.
find median
then split arraay in two halves
split it till it becomes smallest no.
then exchange each even no with odd and merge them.= till u get original array.
almost the reverse form of merge sort

On 10/13/08, Tosif Ahmed <[EMAIL PROTECTED]> wrote:
>
> Use heap sort, Make 2 heaps. Keep adding the odd members to first heap
> and even members to the second heap. I believe this will give a
> O(n*logn) complexity.
>
>
>
> On Mon, Oct 13, 2008 at 3:23 PM, Sumedh Sakdeo <[EMAIL PROTECTED]>
> wrote:
>> Consider
>> Array C = {a1, b1, a2, b2, a3, b3, ... }
>>    such that
>>    a1<a2<a3<....
>>    b1<b2<b3<....
>>
>> Input: array C
>>
>> Output: Sorted array C with complexity < O(n * log n)
>>
>>
>>
>>
>> >
>>
>
>
>
> --
> Regards
> Tosif Ahmed
>
> >
>

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