update insertion_sort

This commit is contained in:
Rohit Tanwar
2018-02-20 17:08:10 +05:30
parent 9e7878b00d
commit 7cc78ca4c4
28 changed files with 1252 additions and 1222 deletions

View File

@ -7,11 +7,11 @@ def insertionsort(arr):
for i in range(1, len(arr)):
key = arr[i]
j = i-1
while j>=0 and key < arr[j]:
arr[j+1] = arr[j]
j = i - 1
while j >= 0 and key < arr[j]:
arr[j + 1] = arr[j]
j -= 1
arr[j+1] = key
arr[j + 1] = key
```
```python