Or login with:
| intulam_distance( | int | n | |
| int* | a | ||
| int* | b | )[inline] |
#include <codecogs/maths/combinatorics/permutations/ulam_distance.h> #include <iostream> int main() { int sigma[5] = {1, 2, 3, 4, 5}, tau[5] = {5, 2, 1, 4, 3}, distance = Maths::Combinatorics::Permutations::ulam_distance(5, sigma, tau); std::cout << "The Ulam metric distance of Sigma and Tau is: "; std::cout << std::endl << distance << std::endl; return 0; }Output:
The Ulam metric distance of Sigma and Tau is:
3| n | the size of the permutations |
| a | the first permutation |
| b | the second permutation |
Source code is available when you agree to a GP Licence or buy a Commercial Licence.
Not a member, then Register with CodeCogs. Already a Member, then Login.
You must login to leave a messge