You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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.
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:
Expected Behavior
When
pop
method is called on stack, it should return "second" as the value and set the index 1 to nullThe text was updated successfully, but these errors were encountered: