This is an old revision of the document!


5.3 Counting Inversions


Counting inversions is a problem that we face when analyzing rankings in several applications. The main challenge in this category of problems is to find a way to efficiently compare the rankings.
Let's suppose we have a sequence of n numbers a1,a2,a3,…,an, assuming that all the numbers are different. Our concern is to find a measure that tells us how far this sequence is from being in ascending order. The value of that measure should be 0 if the list is sorted and should increase as the list gets more scrambled. Two indices i<j are inverted if ai > ajj, this means that ai appears after aj even though i<j.

courses/cs211/winter2012/journals/jeanpaul/chapter_fivesection_iii.1331585541.txt.gz · Last modified: 2012/03/12 20:52 by mugabej
CC Attribution-Noncommercial-Share Alike 4.0 International
Driven by DokuWiki Recent changes RSS feed Valid CSS Valid XHTML 1.0