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

[ISSUE] Wrong explanation for "ArrayDeque for stack" #17355

Open
ravening opened this issue Aug 15, 2024 · 0 comments
Open

[ISSUE] Wrong explanation for "ArrayDeque for stack" #17355

ravening opened this issue Aug 15, 2024 · 0 comments
Labels
on-jira triaged Issues reviewed by a dev and considered valid. Will be added in Jira.

Comments

@ravening
Copy link

Article and Module Links
Java ArrayDeque

Describe the Issue
When ArrayDeque is used to implement a stack, it acts as LIFO(Last In First Out). So the element which is added at the last should be removed first. So in the above mentioned link, we are inserting two elements into stack. "first" and "second" . When we call the pop function, the element "second" should be removed first but the explanation says "first" will be removed which is wrong.

To Reproduce
Steps to reproduce the behavior:

  1. Go to this link
  2. Read the description and the text in the image
  3. The description is wrong

Expected Behavior
When pop method is called on stack, it should return "second" as the value and set the index 1 to null

@ulisseslima ulisseslima added the triaged Issues reviewed by a dev and considered valid. Will be added in Jira. label Aug 26, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
on-jira triaged Issues reviewed by a dev and considered valid. Will be added in Jira.
Projects
None yet
Development

No branches or pull requests

3 participants