## Check if two nodes are cousins in a Binary Tree | Set-2

Given a binary tree and the two nodes say ‘a’ and ‘b’, determine whether two given nodes are cousins of each other or not. Two… Read More »

## Check if a binary tree is sorted level-wise or not

Given a binary tree. The task is to check if the binary tree is sorted level-wise or not. A binary tree is level sorted if… Read More »

## Find maximum level product in Binary Tree

Given a Binary Tree having positive and negative nodes, the task is to find maximum product level in it. Examples: Input : 4 / \… 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 »

## Smallest value in each level of Binary Tree

Given a binary tree containing n nodes, the task is to print minimum element in each level of binary tree. Examples: Input : 7 /… Read More »

## Level order traversal line by line | Set 3 (Using One Queue)

Given a Binary Tree, print the nodes level wise, each level on a new line. Output: 1 2 3 4 5 Recommended: Please solve it… Read More »

## Construct a tree from Inorder and Level order traversals | Set 2

Given inorder and level-order traversals of a Binary Tree, construct the Binary Tree. Following is an example to illustrate the problem. Examples: Input: Two arrays… Read More »

## Print Binary Tree levels in sorted order | Set 2 (Using set)

Given a tree, print the level order traversal in sorted order. Examples : Input : 7 / \ 6 5 / \ / \ 4… Read More »

## Print Binary Tree levels in sorted order

Given a Binary tree, the task is to print its all level in sorted order Examples: Input : 7 / \ 6 5 / \… 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 »

## Largest value in each level of Binary Tree

Given a binary tree, find the largest value in each level. Examples : Input : 1 / \ 2 3 Output : 1 3 Input… 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 »

## 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 »

## 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 »

## 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 »