Great article! I believe you cheated here a little bit though. The lower level implementation would need to remember the current head (index in the array) and accordingly update the head on push/pop actions. The whole point of implementing a Stack is to learn programming, so it should be done on the lowest level possible. Cheers!
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
Great article! I believe you cheated here a little bit though. The lower level implementation would need to remember the current head (index in the array) and accordingly update the head on push/pop actions. The whole point of implementing a Stack is to learn programming, so it should be done on the lowest level possible. Cheers!