*Hey in this code i will make a stack implementation programme *
We have a class "Stack
" :
in this class i make a all method for implement stack ,
i using Integer Array to store Stack Data, and in this class we have a some other propertys ,
like : i am define the Stacksize but when i create a object to am define my new stack size , and we have a **indexvalue **of array for where to stack fill data in array and find data and remove
* THIS IS STACK CLASS
in this class we have a some method like
- public void size() -> to store the size of stack;
- public void push() -> to push data in stack
- public void pop() -> to remove last element of stack array
- public void remove() -> to remove stack element but give the indexvalue of element which one you want to remove
- public void getStack() -> and get all stack values
Methods implement
NOW MAKE A OBJECT AND MAKE A STACK
when an create a object to use stack to am define here my stack size 2 so am set only 2 integer data in stack
if you want to code of this stack implementation go to my github repo
github
Top comments (0)