Problem Statement: Design a data structure to implement ‘N’ stacks using a single array of size ‘S’. It should support
Continue readingCategory: 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 readingEvaluation of Postfix Expression
Given a postfix expression Containing only operators [+, – , *, / ] and numbers. Postfix expression is given the
Continue readingEvaluation of Prefix expression
Problem Statement: Evaluation of prefix expression step by step. Examples: Example 1: Input: * 5 4 Output: 20 Explanation: Refer
Continue readingInfix to Prefix
Problem Statement: Given an infix expression, Your task is to convert the given infix expression to a prefix expression. Examples:
Continue readingInfix to Postfix
Problem Statement: Given an infix expression, Your task is to convert the given infix expression to a postfix expression. Examples:
Continue readingApplications of Stack
What is a stack? Stack is a linear data structure in which elements are stored in a certain order. It
Continue readingStack 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 readingPost-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 readingArea 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