from where does the index starts, 0 or 1 ? in this, array to be moved is
{7, 5, 8} ?
and source array                       the destination
            |                                             |
 {9,   7, 5, 8,             1, 5, 4, 8,           10,                 1}

please explain move_set operation ?

On Sat, Jul 9, 2011 at 6:06 PM, Gopi <[email protected]> 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 [email protected].
> To unsubscribe from this group, send email to
> [email protected].
> 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 [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/algogeeks?hl=en.

Reply via email to