You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The Queue implementation, as it currently stands uses a list and then does a self.items.insert(0, item) to insert an item in the Queue.
This is inefficient. A better approach is to modify Queue to use a deque under the hood, instead of a list for increased efficiency.
Please let me know if you agree with the above approach so that I can send a pull request with the appropriate changes.
The text was updated successfully, but these errors were encountered:
Completely agree. When I wrote that, I wasn't sure using a library ready queue (deque) was a good idea for implementing a queue. Feel free to send in a PR and I'll take a look. 👍
The
Queue
implementation, as it currently stands uses a list and then does aself.items.insert(0, item)
to insert an item in theQueue
.This is inefficient. A better approach is to modify
Queue
to use adeque
under the hood, instead of a list for increased efficiency.Please let me know if you agree with the above approach so that I can send a pull request with the appropriate changes.
The text was updated successfully, but these errors were encountered: