Skip to content

Add Queue #22

Closed
Closed
@czgdp1807

Description

@czgdp1807

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:

  1. An empty queue should be constructed by using Queue().

  2. New elements should be added to the end by using .append(elem).

  3. The elements should be removed from the front using .popleft().

  4. The number of elements in the queue should be returned by len i.e, __len__ method should be over-rided in the Queue 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.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions