by Dinesh Thakur Category: Searching And Sorting

An important subclass of lists permits the insertion and deletion of an element to occur only at one end. A linear list of this type is known as ‘stack’.

The insertion is referred to as ‘push’. The deletion is referred to as ‘pop’. The two pointers used for accessing is top & bottom pointer.


PUSH – Storing the element into the stack.

Check top<= allowed size if yes increment the top position and store the value in the top position.

POP -  Deleting the element from the stack. If top<= we can not delete.

Otherwise decrement the top by one and return the top+1 element.


About Dinesh Thakur

Dinesh ThakurDinesh Thakur holds an B.C.A, MCSE, MCDBA, CCNA, CCNP, A+, SCJP certifications. Dinesh authors the hugely popular blog. Where he writes how-to guides around Computer fundamental , computer software, Computer programming, and web apps. For any type of query or something that you think is missing, please feel free to Contact us.