in-place N-way shuffle怎么做?# Programming - 葵花宝典
g*u
1 楼
You are given:
M=3, N=4, and a memory block contains:
[1,2,3,4,5,6,7,8,9,10,11,12]
You need to change the memory block into
[9,5,1,10,6,2,11,7,3,12,8,4]
"In-place" means memory constaint is O(1).
M=3, N=4, and a memory block contains:
[1,2,3,4,5,6,7,8,9,10,11,12]
You need to change the memory block into
[9,5,1,10,6,2,11,7,3,12,8,4]
"In-place" means memory constaint is O(1).