Skip to content

Conversation

yeoshuheng
Copy link
Collaborator

refactored stack & queue, added unit test & README for both.
Monotonic queue will be rewritten, so no unit test yet too.

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.
Copy link
Collaborator

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!

Copy link
Collaborator

@euchangxian euchangxian left a 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!

@euchangxian euchangxian merged commit 2f73ff7 into 4ndrelim:main Aug 15, 2023
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