Generate every permutation of a finite list by recursively permuting its tail and inserting its head into each possible position. For distinct input elements, every shorter permutation has insertion positions, giving results. Removing the distinguished head reconstructs the unique shorter permutation and insertion position.

Articles by others on the same topic (0)

There are currently no matching articles.