A stack is an abstract data type that serves as a collection of elements, with two principal operations: push, which adds an element to the collection, and pop, which removes the most recently added element that was not yet removed. The order in which elements come off a stack gives rise to its alternative name, LIFO (for last in, first out). Additionally, a peek operation may give access to the top without modifying the stack.

Considered as a linear data structure, the push and pop operations occur only at one end of the structure, referred to as the top of the stack. This makes it possible to implement a stack as a singly linked list and a pointer to the top element.

A stack may be implemented to have a bounded capacity. If the stack is full and does not contain enough space to accept an entity to be pushed, the stack is then considered to be in an overflow state. The pop operation removes an item from the top of the stack.

In this post, we have list out commonly asked interview questions that uses stack data structure-

- Stack Implementation

- Stack Implementation using Linked List

- Check if given expression is balanced expression or not

- Find duplicate parenthesis in an expression

- Evaluate given postfix expression

- Decode the given sequence to construct minimum number without repeated digits

- Design a stack which returns minimum element in constant time

- Design a stack which returns minimum element without using auxiliary stack

- Reverse a string without using recursion

- Reverse a string using stack data structure

- Inorder Tree Traversal | Iterative & Recursive

- Preorder Tree Traversal | Iterative & Recursive

- Postorder Tree Traversal | Iterative & Recursive

- Find ancestors of given node in a Binary Tree

- Check if two given binary trees are identical or not | Iterative & Recursive

- Reverse Level Order Traversal of Binary Tree

- Reverse given text without reversing the individual words

- Find all binary strings that can be formed from given wildcard pattern

- Iterative Implementation of Quicksort

- Depth First Search (DFS) | Iterative & Recursive Implementation

- Invert given Binary Tree | Recursive and Iterative solution

- Print leaf to root path for every leaf node in a binary tree

- Longest Increasing Subsequence

**Thank you for being with us. ðŸ™‚**

## Leave a Reply