Category Archives: Queue

Implementation of Deque using circular array

Deque or Double Ended Queue is a generalized version of Queue data structure that allows insert and delete at both ends.In previous post we had discussed introduction of deque. Now in this post we see how we implement deque Using circular array. Operations on Deque: Mainly the following four basic operations are performed on queue:… Read More »

Find maximum level sum in Binary Tree

Given a Binary Tree having positive and negative nodes, the task is to find maximum sum level in it. Examples: Input : 4 / \ 2 -5 / \ /\ -1 3 -2 6 Output: 6 Explanation : Sum of all nodes of 0’th level is 4 Sum of all nodes of 1’th level is… Read More »

Implement a stack using single queue

We are given queue data structure, the task is to implement stack using only given queue data structure. We have discussed a solution that uses two queues. In this article, a new solution is discussed that uses only one queue. This solution assumes that we can find size of queue at any point. The idea… Read More »