Superpermutation minimisation: Difference between revisions

Content added Content deleted
Line 663: Line 663:
};
};
do {
do {
r := R(n);
r := R(n);
}
}
while(r);
while(r);
}
}
Line 686: Line 686:
superperm(11) len = 43954713
superperm(11) len = 43954713
</pre>
</pre>

=={{header|Perl}}==
=={{header|Perl}}==
This uses a naive method of just concatenating the new permutation to the end (or prepending to the front) if it is not already in the string. Adding to the end is similar to Python's '''s_perm1()''' function.
This uses a naive method of just concatenating the new permutation to the end (or prepending to the front) if it is not already in the string. Adding to the end is similar to Python's '''s_perm1()''' function.