November 10th, 2011, 03:23 AM
You're right, I'm not bothering with merge sort. The target list is not mergable anyway. Only one operation allowed. Also, "fewer comparisons" is not an issue, as the comparison operation is...
November 10th, 2011, 03:12 AM
Well... yes and no. I fetch the list from web, can use extra storage for _temporary_ work and then store the result back "in-place-wise". So conventional efficiency measurements (O-notation) don't...
November 9th, 2011, 10:47 AM
No way to edit posts here? There's obviously a contradiction in my definition of the operation and the example.
The operation is better defined as:
-Move an item X to the slot after item Y, or...
November 9th, 2011, 10:37 AM
I need a sorting algorithm which operates on a single, pre-populated array, and which is limited to perform only one operation:
-Move an item to position P, pushing all elements from position P+X...