Are there any better methods to do permutation of string?

前端 未结 20 1633
醉话见心
醉话见心 2020-11-27 11:15
void permute(string elems, int mid, int end)
{
    static int count;
    if (mid == end) {
        cout << ++count << \" : \" << elems << end         


        
20条回答
  •  没有蜡笔的小新
    2020-11-27 11:43

    If you are interested in permutation generation I did a research paper on it a while back : http://www.oriontransfer.co.nz/research/permutation-generation

    It comes complete with source code, and there are 5 or so different methods implemented.

提交回复
热议问题