-
Notifications
You must be signed in to change notification settings - Fork 15
Stack & Queue #27
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
Stack & Queue #27
Conversation
src/dataStructures/queue/README.md
Outdated
Deque is a variant of queue where elements can be removed or added from the head and tail of the queue. | ||
Deque could come in handy when trying to solve sliding window problems. | ||
|
||
However, it is important to note that when implementing a deque, unlike a queue, you would require a doubly linked list. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would recommend rephrasing the statement "unlike a queue, you would require a doubly linked list" as it could lead to misunderstandings that it's the only method of implementing a deque. Perhaps you could consider mentioning that deques can be implemented using arrays or even with 2 stacks!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Overall LGTM except for a minor issue!
refactored stack & queue, added unit test & README for both.
Monotonic queue will be rewritten, so no unit test yet too.