Reverse elements of set from start to end
Reverse elements of set from end+1 to destination
Reverse elements of set from start to destination

DONE
O(n)

On Sat, Jul 9, 2011 at 7:25 PM, Yogesh Yadav <medu...@gmail.com> wrote:

> @gopi: i didnt really understand what u want to say... what start,end and
> destination denotes here??
>
> u said it should start with 1 but in result it is starting with 9...plz
> explain ur question again....
>
>
> On Sat, Jul 9, 2011 at 7:21 PM, Gopi <kodaligopi...@gmail.com> wrote:
>
>> Hi Geeks
>>
>> Can anyone please comment on this.
>> Let me know if the problem description is not clear enough.
>>
>> Thanks
>> Gopi
>>
>> On Jul 9, 5:36 pm, Gopi <kodaligopi...@gmail.com> wrote:
>> > Write code to move a set of elements (represented by start and end
>> > indexed) in an array to a given destination location (denoted by
>> > destination index).
>> >
>> > For example:
>> > Let say our array is {9, 7, 5, 8, 1, 5, 4, 8, 10, 1}
>> >
>> > move_set (array, start = 1, end = 3, destination = 8)
>> >
>> > should rearrage the array such that the new array looks like {9, 1, 5,
>> > 4, 8, 10, 7, 5, 8, 1}
>> >
>> > Try to come up with an algorithm that is faster than O(n^2)
>> >
>> > Thanks
>> > Gopi
>>
>> --
>> 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.
>>
>>
>  --
> 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.
>



-- 
Sunny Aggrawal
B-Tech IV year,CSI
Indian Institute Of Technology,Roorkee

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