Stack Implementation

#Stack can be implemented in Simple ways

1)Static implementation-

In static Implementation use Array**(datatype)** To Create a stack. It is a collection of elements of same data type stored at contiguous memory locations.

In Static implementation a variable(MAX STK)which gives the maximum number of element,

*The condition Top=0 & Top=null will be indicate the Stack is empty.

#Stack Representation In Array-

Ex.The stack is three element x,y,z

*This fig,show here, Top=3(z) & MAX STK=7 (So This Stack allows room for 5 more item in stack)

*The operation perform of adding a new item on this stack is known as PUSH & removing an item form this stack is also known as POP

“To wrap up, we learned about #Stack implemention,#Stack Representation in Array.

2
Subscribe to my newsletter

Read articles from Yash Bhandwalkar directly inside your inbox. Subscribe to the newsletter, and don't miss out.

Written by

Yash Bhandwalkar
Yash Bhandwalkar