Advertisement
canorve

Peculiar Sort algorithm

Apr 25th, 2021
229
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.41 KB | None | 0 0
  1. #!/usr/bin/python3
  2.  
  3. import time
  4. from threading import Thread
  5.  
  6. #peculiar sort algorithm
  7.  
  8. class Number:
  9.  
  10.     def sort(self,unsort):
  11.         self.unsort=unsort
  12.         for n in unsort:
  13.             sorthread = Thread(target=Number().timer, args=(n,))
  14.             sorthread.start()
  15.  
  16.     def timer(self,num):
  17.         time.sleep(num)
  18.         print("Number: ",num)
  19.  
  20. num = [3,5,6,9,1,8,2,7]
  21. Number().sort(num)
  22.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement