why not block reversal?

On Fri, Jul 2, 2010 at 5:36 PM, Saurabh Ahuja <nsit.saur...@gmail.com>wrote:

> a[0] = a[2]
> a[1] = a[3]
> a[2] = a[4]
>
> a[0] and a[1] has been changed
> a[3] = a[0]
> a[4] = a[1]
>
> so this solution would not work.
>
>
> On Fri, Jul 2, 2010 at 5:14 PM, Akash Gangil <akashg1...@gmail.com> wrote:
>
>> wouldn't this work:
>>
>>
>>
>> for i in range(0,len)
>>     a[i] = a[(i+2)%5];
>>
>> where len is the length of array
>>
>>
>> On Sat, Jun 26, 2010 at 3:37 PM, sharad kumar 
>> <sharad20073...@gmail.com>wrote:
>>
>>> i have to right rotate an array by k positions
>>> 1 2 3 4 5 for k=2 o/p shud be
>>> 3 4 5 1 2
>>>
>>>
>>> P.S---do not give block reversal method for array rotation and soln must
>>> be inplace.....plzz write ur logic also along with d code
>>>
>>> --
>>> 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.
>>>
>>
>>
>>
>> --
>> Best Regards
>> Akash Gangil
>>
>>  --
>> 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<algogeeks%2bunsubscr...@googlegroups.com>
> .
> For more options, visit this group at
> http://groups.google.com/group/algogeeks?hl=en.
>



-- 
Man goes to doctor. Says he's depressed. Says life seems harsh and cruel.
Says he feels all alone in a threatening world where what lies ahead is
vague and uncertain. Doctor says "Treatment is simple. Great clown
Pagliacci is in town tonight. Go and see him. That should pick you up." Man
bursts into tears. Says "But, doctor...I am Pagliacci."

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