do it something like this

1,2,3,4,5,6, 7,8

swap 4,5

1,2,3,5,4,6,7,8

swap 3,5 and 4,6

1,2,5,3,6,4,7,8


now swap

3,6 and 2,5 and 4,7

1,5,2,6,3,7,4,8




the idea is to bri


Best Regards
Ashish Goel
"Think positive and find fuel in failure"
+919985813081
+919966006652


On Mon, Jul 5, 2010 at 10:03 AM, Jitendra Kushwaha <jitendra.th...@gmail.com
> wrote:

>
> this question discuused before with a proper conclusion...
> please search the forum
>
> On Sat, Jul 3, 2010 at 11:31 PM, jalaj jaiswal 
> <jalaj.jaiswa...@gmail.com>wrote:
>
>>
>>  Let an array contain values : a1,a2,... ,an, b1,b2,..., bn Write a
>> program to change this array to : a1,b1,a2,b2, ..., an,bn in O(n) time and
>> in O(1) space.
>>
>> i did it by shiftng of elements which is not much efficient.. any better
>> way ?
>> --
>> With Regards,
>> Jalaj Jaiswal
>> +919026283397
>> B.TECH IT
>> IIIT ALLAHABAD
>>
>> --
>> You received this message because you are subscribed to the Google Groups
>> "Algorithm Geeks" group.
>> To post to this group, send email to algoge...@googlegroups.com.
>> To unsubscribe from this group, send email to
>> algogeeks+unsubscr...@googlegroups.com<algogeeks%2bunsubscr...@googlegroups.com>
>> .
>> For more options, visit this group at
>> http://groups.google.com/group/algogeeks?hl=en.
>>
>
>
>
> --
> Regards
> Jitendra Kushwaha
> MNNIT, Allahabad
>
> --
> You received this message because you are subscribed to the Google Groups
> "Algorithm Geeks" group.
> To post to this group, send email to algoge...@googlegroups.com.
> To unsubscribe from this group, send email to
> algogeeks+unsubscr...@googlegroups.com<algogeeks%2bunsubscr...@googlegroups.com>
> .
> 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 algoge...@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