如何列出字符串/整数的所有排列?
发布于 2018-02-11 08:14:35
我在http://www.programmersheaven.com/mb/Algorithms/369713/369713/permutation-algorithm-help/上找到了伪代码:
makePermutations(permutation) {
if (length permutation < required length) {
for (i = min digit to max digit) {
if (i not in permutation) {
makePermutations(permutation+i)
}
}
}
else {
add permutation to list
}
}
https://stackoverflow.com/questions/-100003482
复制相似问题