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.