Problem Statement: Design a data structure to implement ‘N’ stacks using a single array of size ‘S’. It should support

Continue reading# Category: Stack

## Two stacks in an array

Problem Statement: You need to try implementing 2 stacks in a single array. Example: push1(10): Insert 10 in stack1 push2(21):

Continue reading## Evaluation of Postfix Expression

Given a postfix expression Containing only operators [+, – , *, / ] and numbers. Postfix expression is given the

Continue reading## Evaluation of Prefix expression

Problem Statement: Evaluation of prefix expression step by step. Examples: Example 1: Input: * 5 4 Output: 20 Explanation: Refer

Continue reading## Infix to Prefix

Problem Statement: Given an infix expression, Your task is to convert the given infix expression to a prefix expression. Examples:

Continue reading## Infix to Postfix

Problem Statement: Given an infix expression, Your task is to convert the given infix expression to a postfix expression. Examples:

Continue reading## Applications of Stack

What is a stack? Stack is a linear data structure in which elements are stored in a certain order. It

Continue reading## Stack in Data Structure

What is Stack? A stack is a non-primitive linear data structure. it is an ordered list in which the addition

Continue reading## Post-Order Traversal Of Binary Tree

Problem Statement: Postorder Traversal of a binary tree. Write a program for the postorder traversal of a binary tree. Example: Disclaimer:

Continue reading## Area of largest rectangle in Histogram

Problem Statement: Given an array of integers heights representing the histogram’s bar height where the width of each bar is

Continue reading