add permutation related algorithms