Closed
Description
Description of the problem
Currently we use Queue
from collections
module. We want that this should be implemented in pydatastructs
itself, however, without breaking the current code, i.e., the API should be similar to the one of collections
module.
API:
-
An empty queue should be constructed by using
Queue()
. -
New elements should be added to the end by using
.append(elem)
. -
The elements should be removed from the front using
.popleft()
. -
The number of elements in the queue should be returned by
len
i.e,__len__
method should be over-rided in theQueue
class.
Example of the problem
References/Other comments
See the code of OneDimensionalSegmentTree
in pydatastructs.tree.space_partitioning.trees
and BinaryTreeTraversal.breadth_first_search
to know more about the API requirements.