What is data abstraction?
Isolates how a compound data object is used from the details of how it’s constructed.
What is a stack?
They are defined as last in first out data structures.
What does push do?
Adds elements to the top of the stack.
What does peek do?
Returns the top item in a stack.
What does pop do?
Deletes the top item in a stack.
What are the steps involved in pushing an item onto a stack?
First check if the stack is full. If so, report a stack overflow. If not, increase the stack pointer by one. Insert the item at the memory location indicated by the front pointer.
What are the steps involved in popping an item off a stack?
First check if the stack is empty. If so, then report a stack underflow. If not, then delete the top item of the stack and decrease the stack pointer by one.