A
A
asdf12342014-06-03 01:27:31
C++ / C#
asdf1234, 2014-06-03 01:27:31

How to create a library for combinatorial matching algorithm?

It is said that there are permutations, but the source code was not found. I wanted to see as an example.

include <combination.h>
такую библиотеку создать. чтоб в нем содержался классы и методы решение сочетания. 

int main()
{
    std::string s = "abc"; 
    std::sort(s.begin(), s.end());
    do {
        std::cout << s << '\n';
    } while(std::next_combition(s.begin(), s.end()));
}

answer: ab, ac, ba, bc, ca, cb.

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question