algo4: dfs: permutate an array II