Or login with:
| boolcheck( | int | n | |
| int* | p | ) |
#include <codecogs/maths/combinatorics/permutations/check.h> #include <iostream> int main() { int sigma[5] = {1, 3, 2, 3, 4}, tau[4] = {4, 3, 2, 1}; std::cout << "Sigma is "; std::cout << (Maths::Combinatorics::Permutations::check(5, sigma) ? "" : "not "); std::cout << "a valid permutation."; std::cout << std::endl; std::cout << "Tau is "; std::cout << (Maths::Combinatorics::Permutations::check(4, tau) ? "" : "not "); std::cout << "a valid permutation."; std::cout << std::endl; return 0; }
Sigma is not a valid permutation.
Tau is a valid permutation.| n | the size of the p array |
| p | the actual array |
Source code is available when you buy a Commercial licence.
Not a member, then Register with CodeCogs. Already a Member, then Login.
You must login to leave a messge