The 2D array rotation solution says that the run-time complexity for the naive approach is O(n). However, the size of the 2D array is n x n. Shouldn’t the run-time complexity be O(n^2) since we move every element in the original matrix?
Furthermore, it says that the run-time complexity for the recursive approach is O(n lg n). However, I think the recurrence should be T(n) = 4T(n/2) + O(n^2), which reduces to O(n^2 lg n) according to case 2 of the Master Theorem. (I say O(n^2) instead of O(n) because we copy each matrix element to the next quadrant.)