We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 247c984 commit eb325e8Copy full SHA for eb325e8
SortingAlgorithms.py
@@ -13,7 +13,7 @@
13
# not optimized, equiv to while version below, but uses for loop
14
def insertion_sort1(A):
15
for i in range(1, len(A)):
16
- for j in range(i-1, 0, -1):
+ for j in range(i-1, -1, -1):
17
if A[j] > A[j+1]:
18
A[j], A[j+1] = A[j+1], A[j]
19
else:
0 commit comments