Skip to content
Advertisement

Is this a stack?

Is this code a stack?

How I can make it better?

This is my first one.

Can i do this using ArrayList?

JavaScript

I didn’t added the isEmpty() method.

Advertisement

Answer

Yes, it is. But you can add checking for overflow, underflow.

And this will be better if you’ll try using collections.

User contributions licensed under: CC BY-SA
2 People found this is helpful
Advertisement