%what's the Big O complexity here for transposing the "a" 1D array.
O(1) -- that is, constant in the size of the array.
%what's the Big O complexity here for transposing the "a" 2D array
In theory, each element only needs to be touched once, so for an n x m matrix it would be O(n*m). (In practice, you need to worry about cache-line conflicts and cache sizes, so the most efficient algorithms in practice involve block algorithms and multiple CPUs, and calculating execution time for them gets more complex.)