We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 32abbf6 commit 2dc1265Copy full SHA for 2dc1265
divide_and_conquer/inversions.py
@@ -93,8 +93,8 @@ def _count_cross_inversions(P, Q):
93
i = j = num_inversion = 0
94
while i < len(P) and j < len(Q):
95
if P[i] > Q[j]:
96
- # if P[1] is > Q[j], then P[k] for all k > i, P[K] > Q[j]
97
- # and therefore are inversions. This claim emerges from the
+ # if P[1] > Q[j], then P[k] > Q[k] for all i < k <= len(P)
+ # These are all inversions. The claim emerges from the
98
# property that P is sorted.
99
num_inversion += (len(P) - i)
100
R.append(Q[j])
0 commit comments