daily pastebin goal
9%
SHARE
TWEET

Untitled

a guest Mar 15th, 2019 60 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. my_queue = Queue.new()
  2. puts "Is the queue empty? #{my_queue.is_empty}"
  3.  
  4. puts "enqueue 10"
  5. my_queue.enqueue(10)
  6. puts "Is the queue empty? #{my_queue.is_empty}"
  7.  
  8. puts "enqueue 20"
  9. my_queue.enqueue(20)
  10. puts "Is the queue empty? #{my_queue.is_empty}"
  11.  
  12. puts "enqueue 30"
  13. my_queue.enqueue(30)
  14. puts "Is the queue empty? #{my_queue.is_empty}"
  15.  
  16. puts "dequeue should return 10: #{my_queue.dequeue()}"
  17. puts "Is the queue empty? #{my_queue.is_empty}"
  18. puts "dequeue should return 20: #{my_queue.dequeue()}"
  19. puts "Is the queue empty? #{my_queue.is_empty}"
  20. puts "dequeue should return 30: #{my_queue.dequeue()}"
  21. puts "Is the queue empty? #{my_queue.is_empty}"
  22. my_queue.print()
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top