inversions | R Documentation |
inversions() counts the number of inversions of a permutation.
inversions(x)
x |
a permutation of 1, 2, ..., n. |
Input must be a list of numbers.
The total number of inversions in a list.
inversionv
inversions(c(3,1,2))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.