Answer: PROCEDURE DELETE(ITEM, STACK, TOP)
[Deletes ‘item’ from the ‘stack’, top is the number of elements currently in ‘stack’.]
1. [Underflow ?]
if (TOP <= 0)
write Stack is empty.
return.
2. [Deleting Element]
item <-- stack[top]
3. [Decrementing top]
top <-- top - 1
4. [FINISH]
return (top).