## Implement Stack Queue using Deque

What is Deque? Deque is a double ended queue, i.e. a special kind of queue in which insertion and deletion can be done at the both rear as well as...

## Implement stack using Priority Queue or Heap

What is a priority queue? The priority queue is a type of queue data structure having one extra feature of giving priority to every element present in the priority queue....

## Queue Using Stacks

Problem statement: Problem is straightforward, we have to implement a queue using stack. Queue: A Queue is a linear data structure. Queue follows the FIFO rule i.e. First in First...

## Implement Stack Using Queue

Problem statement: Given a queue we need to implement a stack data structure. Stack is a linear data structure in which a user can insert and delete an element from...

## Difference Between Array, Queue and Stack

Array: An Array is a collection of elements which are stored in a contiguous memory. The idea is simple i.e. to store the multiple elements together. Due to which we...

## Difference between Stack and Queue Data Structures

What is stack data structure? Stack is a linear data structure in which a user can insert and delete an element from the same end which is known as a...

## Stack and Queues in python

In data structures, stack and queue are part of linear data structure. Stack Stack follows the principle of LIFO (Last in First out) i.e. element which is inserted at last...

## Implement a stack using a singly linked list

Introduction The linked list is one of the most important concepts and data structures to learn while preparing for interviews. Having a good grasp of Linked Lists can be a...

## Python Stack using a Doubly Linked List

Introduction The linked list is one of the most important concepts and data structures to learn while preparing for interviews. Having a good grasp of Linked Lists can be a...

## Program To Reverse A Linked List Using Stack

Problem Statement In this problem we are given a singly linked list and we have to reverse it using a stack. Input: Output: Now, the main question is how to...

## Reverse a stack without using extra space in O(n)

Problem Statement In this problem, we are given a stack. We have to reverse the stack without using extra space in O(n). Problem Statement Understanding As we know, reversing a...

## Play With Brackets

Concepts Used Stack Difficulty Level Easy. Problem Statement : Rashid is given a set of open and closed brackets of each type such as [ , ], ( , )...

## Stack Challenge

Concepts Used Stack Difficulty Level Hard Problem Statement : Rahul and Ritika are playing a game of stacks where each of them are having a stack A and B of...

## K overlapping segment

Concepts Used: Stack. Difficulty Level: Medium. Problem Statement : Arnab is hosting a party but he has only k seats. Guest have come at different times and leave at different...

## Max Rectangle

Concepts Used: DP/recursion and Stack. Difficulty Level: Hard. Problem Statement : Given a 2D binary matrix filled with 0’s and 1’s, find the largest rectangle containing all ones and print...

## Samir String

Concepts Used: Stack. Difficulty Level: Easy. Problem Statement : Make the minimum number without repetition of the digits such that it follows the sequence given in the string. 'I' represents...

## Next Greater Element

Concepts Used: Stacks. Difficulty Level: Medium. Problem Statement : Arnab is standing in a queue and he is irritated by the tall man standing after him, as he is obstructing...

## Sort stack

Concepts Used: Stacks Difficulty Level: Easy. Problem Statement : Given a stack of integers, sort it in ascending order using another temporary stack. See original problem statement here Solving Approach:...

Concepts Used Stack Difficulty Level Easy Problem Statement : Given a string str of lowercase letters, a duplicate removal consists of choosing two adjacent and equal letters, and removing them....

## Get minimum element from stack

Concepts Used: Stack Difficulty Level: Easy. Problem Statement : Design a Data Structure that performs the Stack operation like push(), pop() and one more operation getMin(), getMin() function should return...

## Beach House

Concepts Used: Stack. Difficulty Level: Hard. Problem Statement : Nishant wants to buy a plot of land, which faces the beach. He will buy only a rectangular plot. So he...

## Beautiful Bracket String

Concepts Used: Stack Difficulty Level: Medium. Problem Statement : Find the minimum number of replacements required to make the given string of braces balanced. See original problem statement here Example:...

## Compile Code

Concepts Used: Stacks. Difficulty Level: Medium. Problem Statement : Given a string of open angular bracket ‘<‘ and closed bracket ‘>’. The task is to find the length of longest...

## Arrogant Students

Concepts Used: Stacks Difficulty Level: Hard. Problem Statement : Sachin is teaching a group of N students. Now every student has an arrogance level. He make all the N students...