A Priority Queue is different from a normal queue, because instead of being a “first-in-first-out”, values come out in order by priority. It is an… Read More »
Prerequisite – Circular Singly Linked List We have discussed basics and how to implement circular queue using array in set 1. Circular Queue | Set… Read More »
Prerequisite – Queues Circular Queue is a linear data structure in which the operations are performed based on FIFO (First In First Out) principle and… Read More »
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… Read More »
Given a binary matrix of N x M, containing at least a value 1. The task is to find the distance of nearest 1 in… Read More »
Given an array of both positive and negative integers, the task is to compute sum of minimum and maximum elements of all sub-array of size… Read More »
Given a Binary Tree having positive and negative nodes, the task is to find maximum sum level in it. Examples: Input : 4 / \… Read More »
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… Read More »
Given a matrix of dimension m*n where each cell in the matrix can have values 0, 1 or 2 which has the following meaning:
Deque or Double Ended Queue is a generalized version of Queue data structure that allows insert and delete at both ends.
We have discussed efficient implementation of k stack in an array. In this post, same for queue is discussed. Following is the detailed problem statement.
Given a number n, write a function that generates and prints all binary numbers with decimal values from 1 to n.
Priority Queue is an extension of queue with following properties. 1) Every item has a priority associated with it. 2) An element with high priority… Read More »
In the previous post, we introduced Queue and discussed array implementation.
Like Stack, Queue is a linear structure which follows a particular order in which the operations are performed.