Queue Python

Define a class Queue which implements the abstract data type queue. As part of your definition of Queue, define the following methods:__init__(self) which creates an empty queue.
enqueue(self, x) which adds x to the end of the queue.
dequeue(self) which removes and returns the first (= oldest) element in the queue.
__len__(self) which returns the total number of elements currently in the queue.
You are free to define and use suitable instance variables to store the items in

×
New Download