Learn
Queues: Python
Queues Python Review

Congrats! You have just implemented a queue data structure in Python by creating a Queue class that:

  • follows FIFO protocol with enqueue(), dequeue(), and peek() methods
  • gives you the option of creating bounded queues with a max_size
  • prevents queue “overflow” and “underflow” by keeping track of size

Instructions

1.

At the bottom of queue.py, uncomment the commented statements and run your code to see some queue-tiful code in action!

Folder Icon

Sign up to start coding

Already have an account?