# Category: Stacks

## Implement Queue Using Stacks

“Implement Queue using Stacks” is a classic interview problem based on stack and queue data structures. Here, we have given two stacks and our task is to implement queue using these two stack.  Stack contains basically two operations, including:  push and pop. To implement queue using given two stacks, we need to perform some...

## Minimum number of Bracket Reversals Needed to make an expression balanced

“Minimum number of Bracket Reversals Needed to make an expression balanced” is again an important application of stack data structure. Here, we have given an expression consisting of parenthesis of type ‘{‘ and ‘}’. Our task is to find the minimum number of bracket reversal needed to make an expression balanced....

## Next Greater Element

“Next Greater Element” is a classic interview problem based on stack data structure. Here, we have given an array with ‘n’ elements. Our task is to print next greater element of each element of an array. If there is no greater element for any element in an array, simply print...

## Check for balanced parentheses

“Check for balanced parentheses” is one of an ideal application of stack data structure. Here, we have given a parentheses string and our aim is to check whether the given string is balanced parentheses string or not.  Balanced parentheses strings are those strings who have closing parentheses like }, ], ) for each...

## Postfix to Prefix Conversion

“Postfix to Prefix Conversion” is a classic example of  stack data structure. Stack can be used to convert given postfix expression to corresponding prefix expression. Operator: Operator are symbols that instruct the computer to perform simple and single tasks. Examples of operators includes + (Addition), – (Subtraction), * (multiplication),… and many...

## Postfix to Infix Conversion

“Postfix to Infix conversion” is a classic example of  stack data structure. Stack can be used to convert given postfix expression to corresponding infix expression. Operator: Operator are symbols that instruct the computer to perform simple and single tasks. Examples of operators includes + (Addition), – (Subtraction), * (multiplication),… and many...

## Prefix to Postfix Conversion

“Prefix to postfix conversion” is a classic example of  stack data structure. Stack can be used to convert given prefix expression to corresponding postfix expression. Operator: Operator are symbols that instruct the computer to perform simple and single tasks. Examples of operators includes + (Addition), – (Subtraction), * (multiplication),… and many...

## Prefix to Infix Using Stack

“Prefix to Infix Using Stack” is a classic example of  stack data structure. Stack can be used to convert given prefix expression to corresponding infix expression. Operator: Operator are symbols that instruct the computer to perform simple and single tasks. Examples of operators includes + (Addition), – (Subtraction), * (multiplication),… and...

## Infix to Postfix Conversion

“Infix to postfix conversion” is a classic example of  stack data structure. Stack can be used to convert given infix expression to corresponding postfix expression. Operator: Operator are symbols that instruct the computer to perform simple and single tasks. Examples of operators includes + (Addition), – (Subtraction), * (multiplication),… and many...

## Infix to Prefix Conversion

“Infix to prefix conversion” is a classic example of  stack data structure. Stack can be used to convert given infix expression to corresponding prefix expression. Operator: Operator are symbols that instruct the computer to perform simple and single tasks. Examples of operators includes + (Addition), – (Subtraction), * (multiplication),… and many...