- #1
phillyj
- 30
- 0
I'm having trouble understanding how to do a perfect shuffle of a vector. I'm supposed to split the vector in half then the 1st element is the 1st element in the first half and the 2nd element is the 1st element of the 2nd half, and so on.
For example, if I have [1 2 3 4 5 6]
then I need to rearrange it into [1 4 2 5 3 6]
Can someone at least help me with the pseudo-code? I been thinking about this a few days with no luck. I am only allowed a few functions like "find" or "length". Nothing complex.
For example, if I have [1 2 3 4 5 6]
then I need to rearrange it into [1 4 2 5 3 6]
Can someone at least help me with the pseudo-code? I been thinking about this a few days with no luck. I am only allowed a few functions like "find" or "length". Nothing complex.