Permutations in backtracking iterative and recursive