Compute the Index of a Permutation in C/C++

I’ve written a C++ code snippet to compute the index of permutation according to this post:

The code was written to be easily adapted into C code. To adapt the code above to C code, simply replace all template types with the type you want and remove all the template declaration.

Leave a Reply

Your email address will not be published.