## Check whether a binary tree is a full binary tree or not | Iterative Approach

Given a binary tree containing n nodes. The problem is to check whether the given binary tree is a full binary tree or not. A… Read More »

## queue::front() and queue::back() in C++ STL

Queue are a type of container adaptors which operate in a first in first out (FIFO) type of arrangement. Elements are inserted at the back… Read More »

## Sum of leaf nodes at minimum level

Given a binary tree containing n nodes. The problem is to get the sum of all the leaf nodes which are at minimum level in… Read More »

## Deepest left leaf node in a binary tree | iterative approach

Given a Binary Tree, find the deepest leaf node that is left child of its parent. For example, consider the following tree. The deepest left… Read More »

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

Queue are a type of container adaptors which operate in a first in first out (FIFO) type of arrangement. Elements are inserted at the back… Read More »

## ZigZag Tree Traversal

Write a function to print ZigZag order traversal of a binary tree. For the below binary tree the zigzag order traversal will be 1 3… Read More »

## Number of visible boxes after putting one inside another

Given N boxes and their size in an array. You are allowed to keep a box inside another box only if the box in which… Read More »

## Iterative diagonal traversal of binary tree

Consider lines of slope -1 passing between nodes. Given a Binary Tree, print all diagonal elements in a binary tree belonging to same line. Input… Read More »

## Check if the given array can represent Level Order Traversal of Binary Search Tree

Given an array of size n. The problem is to check whether the given array can represent the level order traversal of a Binary Search… Read More »

## BFS using STL for competitive coding

A STL based simple implementation of BFS using queue and vector in STL. The adjacency list is represented using vectors of vector. In BFS, we… Read More »

## Construct BST from its given level order traversal

Construct the BST (Binary Search Tree) from its given level order traversal. Examples: Input : arr[] = {7, 4, 12, 3, 6, 8, 1, 5,… Read More »

## K-th ancestor of a node in Binary Tree

Given a binary tree in which nodes are numbered from 1 to n. Given a node and a positive integer K. We have to print… Read More »

## General Tree (Each node can have arbitrary number of children) Level Order Traversal

Given a generic tree, perform a Level order traversal and print all of its nodes Input : 10 / / \ \ 2 34 56… Read More »

## Queue in Standard Template Library (STL)

Queues are a type of container adaptors which operate in a first in first out (FIFO) type of arrangement. Elements are inserted at the back… Read More »

## Print level order traversal line by line | Set 1

Given a binary tree, print level order traversal in a way that nodes of all levels are printed in separate lines. For example consider the… Read More »