Guest User

Untitled

a guest
Dec 10th, 2018
84
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.17 KB | None | 0 0
  1. def insertion_sort(n):
  2. for p in range(1, len(n)):
  3. i = p
  4. while i != 0 and n[i] < n[i-1]:
  5. n[i-1], n[i] = n[i], n[i-1]
  6. i -= 1
  7. return n
Add Comment
Please, Sign In to add comment