array interleaving problem
- by Matt
I was looking for something over the web when I came across this question. Have no idea of how to solve it. Help me out please.
Suppose we have an array
a1,a2,... ,an, b1,b2,..., bn
How to change this array to
a1,b1,a2,b2, ..., an,bn in O(n) time and in O(1) space.