Algorithm 242: Permutations of a set with repetitions

p r o c e d u r e P E R M U T A T I O N (X, K, j , process); a r r a y X; i n t e g e r a r r a y K; i n t e g e r j ; p r o c e d u r e process; c o m m e n t P E R M U T A T I O N generates all the dis t inct pe rmuta t ions of an ar ray of numbers consist ing of K[1] numbers equal to X[1], K[2] numbers equal to X[2], . . , K[j] numbers equal to X[j]. The… CONTINUE READING