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

feat: modified queue to use VecDeque instead of Vec #98

Merged
merged 1 commit into from
Oct 9, 2024

Conversation

Daniel729
Copy link
Contributor

Also removed pointless return value of Queue::enqueue (if it fails it panics)

The original implementation's dequeue runs with O(n) efficiency, as pointed out by Vec::remove's documentation:

Note: Because this shifts over the remaining elements, it has a worst-case performance of O(n).

Also removed pointless return value of Queue::enqueue (if it fails it panics)
@alexfertel
Copy link
Owner

Thank you!

@alexfertel alexfertel merged commit 06c906d into alexfertel:main Oct 9, 2024
3 checks passed
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

Successfully merging this pull request may close these issues.

2 participants