Guest User

Untitled

a guest
Dec 17th, 2018
68
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.20 KB | None | 0 0
  1. def insertion_sort(arr):
  2. for i in xrange(1, len(arr)):
  3. key = arr[i]
  4. j = i-1
  5. while j >= 0 and key < arr[j]:
  6. arr[j+1] = arr[j]
  7. j -= 1
  8. arr[j+1] = key
Add Comment
Please, Sign In to add comment