# Category Archives: Queue

Given a string S consisting of N characters, the task is to find the length of all prefixes of the given string S that are… Read More
The queue is a linear data structure that follows the FIFO rule (first in first out). We can implement Queue for not only Integers but… Read More
Given a Binary Tree consisting of N nodes, the task is to print the Level Order Traversal after replacing the value of each node with… Read More
Given a Binary Tree, the task is to modify the Tree by left rotating every node any number of times such that every level consists… Read More
Given a directed weighted graph consisting of N vertices and an array Edges[][], with each row representing two vertices connected by an edge and the… Read More
In this article, we will discuss how to create a dynamic circular queue using a circular array having the following functionality:  Front(): Get the front… Read More
Design a data structure that supports the following operations in queue efficiently: push__front(x): Insert an element at the front of the queue. push__middle(x): Inserts element… Read More
Given an integer N, representing the number of stairs, valued from 1 to N, and a starting position S, the task is to count the… Read More
Given a weighted graph consisting of N nodes and M edges, a source vertex, a destination vertex, and an integer K, the task is to… Read More
Given a binary matrix mat[][] of dimensions of N * M and pairs of integers src and dest representing source and destination cells respectively, the… Read More
Given an array arr[][] consisting of N segments of the form {L, R, V} where, [L, R] denotes a segment with velocity V in any… Read More
Given a Graph consisting of N vertices and M weighted edges and an array edges[][], with each row representing the two vertices connected by the… Read More
Linear Queue: A Linear Queue is generally referred to as Queue. It is a linear data structure that follows the FIFO (First In First Out)… Read More
Given an integer N, representing the number of nodes present in an undirected graph, with each node valued from 1 to N, and a 2D… Read More
Given a Binary Tree consisting only ‘(‘ and ‘)’ a level is considered to be balanced if the nodes of the level having parenthesis are… Read More