Steps To Implement Stack In Java | Simple Data Structure Introduction
Agenda : 1) What is Stack 2) What are the methods or operations performed in stack 3) What is the Time complexity of stack 4) How can we implement a stack 5) Simple example with output 1) What is Stack : Stack is a linear data structure, which follows the sequential order. It followed the LIFO(Last In First Out) or FILO(First In Last Out) insertion order. 2) What are the methods or operations performed in stack : Basically there are five type of operations are available in stack and these are below, Push : This method will add the elements in stack if stack is not full, if it's full then it will show an overflow condition. Pop : This method will remove the elements from the stack. And elements are get removed by the reversed order in which they are pushed. If the stack is empty, then it will show an underflow condition. Peek or Top: This method will returns top element of stack. isEmpty: This method will returns true if stac...