Skip to content

Category Archives: Queue

Given an unweighted graph and a boolean array A[ ], where if the ith index of array A[ ] denotes if that node can can… Read More
The task is to implement a dynamic Deque using templates class and a circular array, having the following functionalities:   front(): Get the front item… Read More
Given a Binary Search Tree consisting of N nodes and two positive integers L and R, the task is to find the sum of values… Read More
Given a Binary Tree consisting of N nodes and two integers K and L, the task is to add one row of nodes of value… Read More
Given a Binary Tree consisting of N nodes, the task is to find the number of paths from the root to any node X, such… Read More
Given two positive integers A, B, and an array D[] consisting only of digits [0-9], the task is to check if it is possible to… Read More
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