Write a method that moves an element within an array from an index to another. void MoveElement(int *arr, unsigned int size, unsigned int from_index, unsigned int to_index) { if (!arr || size < from_index || size < to_index || from_index == to_index) return; int e = arr[from_index]; if (from_index < to_index) { for (int i = from_index; i < to_index; i++) arr[i] = arr[i + 1]; } else { for (int i = from_index; i > to_index; i--) arr[i] = arr[i - 1]; } arr[to_index] = e; } |