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

Chapter 3: Use of Deque to implement RpnStack #5

Open
isben opened this issue Oct 4, 2024 · 0 comments
Open

Chapter 3: Use of Deque to implement RpnStack #5

isben opened this issue Oct 4, 2024 · 0 comments

Comments

@isben
Copy link

isben commented Oct 4, 2024

In Chapter 3, implementation of the RpnStack is done using a Deque.
While the code is technically correct and properly implements the RpnStack, it is not strictly required.
Replacing the Deque by a simple Vec in the code produces the same result. push and pop operations of a Vec behave exactly as you would expect from an usual stack, hence no need to over complicate things by introducing a Deque

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

1 participant