a guest Jun 20th, 2019 64 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. for i in range(1, len(array)):
  2.     j = array[i]
  3.     k = i -1
  4.     while k >= 0  and array[k]> j:
  5.         array[k+1] =  array[k]
  6.         k -= 1
  7.     array[k+1] = j
  8.     print(" ".join([str(number) for number in array]))
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand