m2skills

Counting sort op

Sep 28th, 2017
545
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.33 KB | None | 0 0
  1. Program to implement counting sort algorithm in python
  2.  
  3. Enter the elements to sorted as spaced integers : 1 2 5 4 7 8 9 6 5 4 3 2 1 5 9 7 5 3 6 5 4
  4. The list before sorting is :
  5. [1, 2, 5, 4, 7, 8, 9, 6, 5, 4, 3, 2, 1, 5, 9, 7, 5, 3, 6, 5, 4]
  6.  
  7. The sorted list is :
  8. [1, 1, 2, 2, 3, 3, 4, 4, 4, 5, 5, 5, 5, 5, 6, 6, 7, 7, 8, 9, 9]
Add Comment
Please, Sign In to add comment