Combinatorica`
Combinatorica`
Inversions
Inversions[p]
counts the number of inversions in permutation p.
更多信息和选项
- To use Inversions, you first need to load the Combinatorica Package using Needs["Combinatorica`"].
Inversions[p]
counts the number of inversions in permutation p.