Closed RobinHankin closed 5 years ago
C functions nextperm() and nextmultiset() in files permutations.c and multiset.c are [almost] identical. I had not realised until just now that nextperm() would work with multisets, provided the line
nextperm()
nextmultiset()
permutations.c
multiset.c
for(j=n-2 ; a[j]>a[j+1] ; j--){ } /* L2 */
is replaced by what it should read which is
for(j=n-2 ; a[j]>=a[j+1] ; j--){ } /* L2 */
C functions
nextperm()
andnextmultiset()
in filespermutations.c
andmultiset.c
are [almost] identical. I had not realised until just now thatnextperm()
would work with multisets, provided the linefor(j=n-2 ; a[j]>a[j+1] ; j--){ } /* L2 */
is replaced by what it should read which is
for(j=n-2 ; a[j]>=a[j+1] ; j--){ } /* L2 */