Guest User

Untitled

a guest
Nov 24th, 2017
71
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.33 KB | None | 0 0
  1. def selectionSort(nums):
  2. for i in range(len(nums)):
  3. minIdx = i
  4. for j in range(i+1, len(nums)):
  5. if nums[minIdx] > nums[j]:
  6. minIdx = j
  7. nums[i], nums[minIdx] = nums[minIdx], nums[i]
  8. return nums // [17, 20, 26, 31, 44, 54, 55, 77, 93]
  9.  
  10. if __name__ == '__main__' :
  11. print selectionSort([54,26,93,17,77,31,44,55,20])
Add Comment
Please, Sign In to add comment