## Find if given vertical level of binary tree is sorted or not

Given a binary tree. Find if a given vertical level of the binary tree is sorted or not. (For the case when two nodes are… Read More »

## Reverse a path in BST using queue

Given a binary search tree and a key, your task to reverse path of the binary tree. Prerequisite : Reverse path of Binary tree Examples… Read More »

## Number of siblings of a given Node in n-ary Tree

Given an N-ary tree, find the number of siblings of given node x. Assume that x exists in the given n-ary tree. Example : Input… Read More »

## Level order traversal with direction change after every two levels

Given a binary tree, print the level order traversal in such a way that first two levels are printed from left to right, next two… Read More »

## Shortest path in an unweighted graph

Given a unweighted graph, a source and a destination, we need to find shortest path from source to destination in the graph in most optimal… Read More »

## Reversing a queue using recursion

Given a queue, write a recursive function to reverse it. Standard operations allowed : enqueue(x) : Add an item x to rear of queue. dequeue()… Read More »

## Smallest multiple of a given number made of digits 0 and 9 only

We are given an integer N. We need to write a program to find the least positive integer X made up of only digits 9’s… Read More »

## Sorting a Queue without extra space

Given a queue with random elements, we need to sort it. We are not allowed to use extra space. The operations allowed on queue are… Read More »

## Path in a Rectangle with Circles

There is a m*n rectangular matrix whose top-left(start) location is (1, 1) and bottom-right(end) location is (m*n). There are k circles each with radius r.… Read More »

## Largest value in each level of Binary Tree | Set-2 (Iterative Approach)

Given a binary tree containing n nodes. The problem is to find and print the largest value present in each level. Examples: Input : 1… Read More »

## queue::emplace() in C++ STL

Queue is also an abstract data type or a linear data structure, which follows a particular order in which the operations are performed. The order… Read More »

## queue::swap() in C++ STL

Queue is also an abstract data type or a linear data structure, which follows a particular order in which the operations are performed. The order… Read More »

## priority_queue::top() in C++ STL

Priority queues are a type of container adaptors, specifically designed such that the first element of the queue is the greatest of all elements in… Read More »

## priority_queue::push() and priority_queue::pop() in C++ STL

Priority queues are a type of container adaptors, specifically designed such that the first element of the queue is the greatest of all elements in… Read More »

## priority_queue::empty() and priority_queue::size() in C++ STL

Priority queues are a type of container adaptors, specifically designed such that the first element of the queue is the greatest of all elements in… Read More »