Stacks and Queues

23 problems to practice.

23 Total
21 Easy
1 Medium
1 Hard

Stock Span

1. Implement the functions of class StockSpanner. 2. next() collects daily price quotes for the s...

easy

Sliding Window Maximum

Given an array nums, there is a sliding window of size k which is moving from the very left of the a...

easy

Duplicate Brackets

1. You are given a string exp representing an expression. 2. Assume that the expression is balanced...

easy

Balanced Brackets

1. You are given a string exp representing an expression. 2. You are required to check if the expre...

easy

Largest Area Histogram

1. You are given a number n, representing the size of array a. 2. You are given n numbers, represen...

hard

Infix Evaluation

1. You are given an infix expression. 2. You are required to evaluate and print it's value.

easy

Infix Conversions

1. You are given an infix expression. 2. You are required to convert it to postfix and print it. 3...

easy

Postfix Evaluation And Conversions

1. You are given a postfix expression. 2. You are required to evaluate it and print it's value. 3....

easy

Prefix Evaluation And Conversions

1. You are given a prefix expression. 2. You are required to evaluate it and print it's value. 3....

easy

Celebrity Problem

1. You are given a number n, representing the number of people in a party. 2. You are given n str...

easy

Merge Overlapping Interval

1. You are given a number n, representing the number of time-intervals. 2. In the next n lines, you...

medium

Smallest Number Following Pattern

1. You are given a pattern of upto 8 length containing characters 'i' and 'd'. 2. 'd' stands for de...

easy

Normal Stack

1. You are required to complete the code of our CustomStack class. The class should mimic the behavi...

easy

Dynamic Stack

1. You are given the code of our CustomStack class which mimics the java.util.Stack class. 2. Here...

easy

Normal Queue

1. You are required to complete the code of our CustomQueue class. The class should mimic the behavi...

easy

Dynamic Queue

1. You are required to complete the code of our CustomQueue class. The class should mimic the behavi...

easy

Minimum Stack - I

1. You are required to complete the code of our MinStack class. 2. As data members you've two sta...

easy

Minimum Stack - Constant Space

1. You are required to complete the code of our MinStack class. 2. As data members you've one stac...

easy

Queue To Stack Adapter - Push Efficient

1. You are required to complete the code of our QueueToStackAdapter class. 2. As data members you'...

easy

Queue To Stack Adapter - Pop Efficient

1. You are required to complete the code of our QueueToStackAdapter class. 2. As data members you'...

easy

Stack To Queue Adapter - Add Efficient

1. You are required to complete the code of our StackToQueueAdapter class. The class should mimic t...

easy

Stack To Queue Adapter - Remove Efficient

1. You are required to complete the code of our StackToQueueAdapter class. The class should mimic th...

easy

Two Stacks In An Array

1. You are required to complete the code of our TwoStack class. The class should implement LIFO beh...

easy