Combinatorica`
Combinatorica`

Inversions

Inversions[p]

counts the number of inversions in permutation p.

更多信息和选项