Skip to content

Instantly share code, notes, and snippets.

@st0le
Created August 30, 2014 05:06
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save st0le/ddd93276ebd78605f307 to your computer and use it in GitHub Desktop.
Save st0le/ddd93276ebd78605f307 to your computer and use it in GitHub Desktop.
Inversion Count - Using Naive Algorithm
def inversionCount_1(A):
c = 0
for i in xrange(len(A)):
for j in xrange(i + 1,len(A)):
if A[i] > A[j]:
c += 1
return c
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment