Computes the partition generated by the given permutation.
Use the following HTML code to embed the calculators within other websites:
Partition
std::vector<int>partition(
int
n
int*
p
)
The problem of finding the partition of the set generated by a certain permutation is the
same with finding its disjoint cycle decomposition. Therefore, each cycle would represent a subset of the original set.
This function returns a C++ vector with the property that if and only if belongs to the subset of order .
For instance, consider the following permutation: