Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Queue implementation currently uses a list under the hood. It should be modified to use a deque to make it efficient. #42

Closed
the-shank opened this issue Sep 26, 2016 · 4 comments

Comments

@the-shank
Copy link
Contributor

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.

@prakhar1989
Copy link
Owner

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-shank
Copy link
Contributor Author

Cool ! I will send the PR shortly.

@the-shank
Copy link
Contributor Author

@prakhar1989 #43 PR sent

@prakhar1989
Copy link
Owner

Merged. Thanks for contributing 🍻

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants