codeintuition-logo

Checking if the stack is empty


As the name suggests, this operation tells the caller if the stack is empty or if some items are already in it. It will return true if the stack is empty and false otherwise. The implementation is the same as that in the array implementation of a stack. We check if the stack's size is equal to 0.

Loading Image

Operation to check if the stack is empty

Algorithm

Liking the course? Check our discounted plans to continue learning.