Skip to content

Commit

Permalink
Update README.md
Browse files Browse the repository at this point in the history
  • Loading branch information
Ayon-SSP authored Jul 27, 2023
1 parent c79396e commit 0a6f395
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions 2]_Algorithms/2]_Sorting/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -189,11 +189,10 @@ print(lst)
def InsertionSort(lst):
n = len(lst)
for i in range(1,n): # i(1 -> n-1)
for j in range(i-1,-1,-1): # j(i -> 0)
if(lst[j]>lst[j+1]):
lst[j],lst[j + 1] = lst[j + 1],lst[j]
else:
break
j = i
while j > 0 and lst[j - 1] > lst[j]:
lst[j - 1], lst[j] = lst[j], lst[j - 1]
j -= 1

lst = [6,11,3,7,12,18,5,1]
InsertionSort(lst)
Expand Down

0 comments on commit 0a6f395

Please sign in to comment.