Advertisement
182days

Queue Example

May 10th, 2016
145
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.24 KB | None | 0 0
  1. #python queue algorithm example
  2. #find, insert and delete functions
  3. try:
  4.     import Queue as Q  # ver. < 3.0
  5. except ImportError:
  6.     import queue as Q
  7.  
  8. q = Q.Queue()
  9. q.put(10)
  10. q.put(1)
  11. q.put(5)
  12. while not q.empty():
  13.     print (q.get(),)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement