Advertisement
Ikmik

heapsort.py

Jun 7th, 2015
269
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.24 KB | None | 0 0
  1. #!/usr/bin/python3
  2. # file: heapsort.py
  3.  
  4. from queue import PriorityQueue
  5.  
  6. q = PriorityQueue()
  7. A = list(map(int, input().split()))
  8. for a in A:
  9.     q.put(a)
  10. A = []
  11. while not q.empty():
  12.     A.append(q.get())
  13. print(" ".join(map(str, A)))
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement