Skip to content

Category Archives: Queue

Given a stream of characters, find the first non-repeating character from the stream. You need to tell the first non-repeating character in O(1) time at… Read More
There are two conventions to define the height of a Binary Tree  Number of nodes on the longest path from the root to the deepest… Read More
Given Linked List Representation of Complete Binary Tree, construct the Binary tree. A complete binary tree can be represented in an array in the following… Read More
Given information about N petrol pumps (say arr[]) that are present in a circular path. The information consists of the distance of the next petrol… Read More
Given a Queue data structure that supports standard operations like enqueue() and dequeue(). The task is to implement a Stack data structure using only instances… Read More
Given an array of non-negative integers. Find the largest multiple of 3 that can be formed from array elements. For example, if the input array is… Read More
Given a Binary Tree, write a function to check whether the given Binary Tree is Complete Binary Tree or not.A complete binary tree is a… Read More
The breadth-first search (BFS) algorithm is used to search a tree or graph data structure for a node that meets a set of criteria. It… Read More
Given an array and an integer K, find the maximum for each and every contiguous subarray of size K. Examples :  Input: arr[] = {1,… Read More
Introduction : A queue is a linear data structure that follows the “first-in, first-out” (FIFO) principle. It is a collection of elements that supports two… Read More
The problem is opposite of this post. We are given a stack data structure with push and pop operations, the task is to implement a… Read More
Given a Binary Tree, the task is to print the Level order traversal of the Binary Tree in spiral form i.e, alternate order. Example: Input:Output:… Read More
Given the root of the Binary Tree. The task is to print the Level order traversal of a tree is breadth first traversal for the… Read More

Start Your Coding Journey Now!