I believe that the runtime of func2 is O(n * log(n)).
But some people have told me that it's not.
int func2(int* arr, int n){
int i, j;
for (i = 1; i <= n; i *= 2)
reverseArray(arr, i);
}
}
void reverseArray(int* arr, int n){
int left, right, temp;
for (left = 0, right = n-1; left <= right; left++, right--){
temp = arr[left];
arr[left] = arr[right];
arr[left] = temp;
}
}