Calculate number of (binary) inversions
- From: "Pete Staab" <pixstamp@xxxxxxx>
- Date: 28 Feb 2006 10:50:21 -0800
Hello!
I'm looking for an algorithm that counts the number of binary
inversions in theta(n) or "normal" inversions in nlog(n).
A sample for binary inversion: (1,0,1,1,0) has 4 inversions: (0,1),
(0,4), (2,4), (3,4).
A sample for normal inversion: (3,1,2,5,4)has 3 inversions: (0,1) (
3>1), (0,2) ( 3>2) (3,4) ( 5>4)
I am writing this question into the theory-group, because I develop the
programm in Perfect Developer (http://www.eschertech.com/).
Thank you,
.
- Prev by Date: Re: Is there a better way to simulate randomly choosing from a weighted set?
- Previous by thread: Is there a better way to simulate randomly choosing from a weighted set?
- Index(es):
Relevant Pages
|