# Category Archives: Queue

Suppose there is a circle. There are n petrol pumps on that circle. You are given two sets of data. The amount of petrol that… Read More
The problem is opposite of this post. We are given a Queue data structure that supports standard operations like enqueue() and dequeue(). We need… 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
Breadth-First Traversal (or Search) for a graph is similar to Breadth-First Traversal of a tree (See method 2 of this post). The only catch… Read More
Given an array and an integer K, find the maximum for each and every contiguous subarray of size k. Examples : Become a success story instead… Read More
Queue is used when things don’t have to be processed immediately, but have to be processed in First In First Out order like Breadth First… 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
Write a function to print spiral order traversal of a tree. For below tree, function should print 1, 2, 3, 4, 5, 6, 7.   Become… Read More