Skip to content

Conversation

@MrWeast
Copy link
Contributor

@MrWeast MrWeast commented Dec 1, 2023

changed implementation to not use built in python lists. added English comments

Description

Previous implementation used built in python lists which seems counter to the point of implementing a queue data structure since python lists already support queue functionality. I also added English comments since there is an open issue about that (#183).

New Queue:

  • queue data structure built from scratch
  • enqueue: will add an element to the tail of the queue
  • dequeue: will remove the element at the head of the queue if the queue is not empty
  • show: will show the elements in the queue, with the first element being the head of the queue
  • length: will return the length of the queue

To test the implementation you can run the file since it includes test cases in the main function of the file

changed implementation to not use built in python lists. added english comments
removed import random and added a comment
fixed formatting
Copy link
Owner

@kelvins kelvins left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @MrWeast

@kelvins kelvins merged commit a0c6d09 into kelvins:main Dec 3, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

2 participants