# Category Archives: Queue

Given a number K, the task is to create the Diamond-like structure of Tree which follows these two conditions:   First K levels of the tree… Read More
Given a Binary Tree, the task is to print all the Exponential Levels in the given Binary Tree.  An Exponential Level is a level whose… Read More
Given a Binary Tree and an integer K where the tree has positive and negative nodes, the task is to print the elements of the… Read More
Given a Complete Binary Tree, the task is to print the elements in the Clockwise traversal order.Clockwise Traversal of a tree is defined as:   For… Read More
Given a natural number N, the task is to print the Nth Stepping or Autobiographical number.  A number is called stepping number if all adjacent… Read More
Given a Binary Tree, the task is to print all levels of this tree in Boundary Level order traversal. Boundary Level order traversal: In this… Read More
Prerequisite: CPU Scheduling in Operating Systems Different Scheduling Algorithms: First Come First Serve CPU Scheduling: Simplest scheduling algorithm that schedules according to arrival times of… Read More
Given a grid A of size N*M consisting of K cells denoted by values in range [1, K], some blocked cells denoted by -1 and… Read More
Given an array arr[] and an integer K. The following operations can be performed on any array element:   Multiply the array element with K. If… Read More
Given an integer K and an array arr[] containing N integers, the task is to find the sum and product of K smallest and K… Read More
Given a non-decreasing array arr[] and an integer K, the task is to remove K elements from the array such that maximum difference between adjacent… Read More
Given a Binary Tree, the task is to print all prime levels of this tree.  Any level of a Binary tree is said to be… Read More
Queue in STL are a type of container adaptors which operate in a first in first out (FIFO) type of arrangement where elements are inserted… Read More
Given a Binary Tree, the task is to print all palindromic levels of this tree.  Palindrome Level Any level of a Binary tree is said… Read More
Pre-requisites: Java Collection Framework. 1. What is the Output of following Java Program? import java.util.*;    class Demo {     public static void main(String[] args)     {… Read More