## Inorder traversal of an N-ary Tree

Given an N-ary tree containing, the task is to print the inorder traversal of the tree. Examples: Input: N = 3 Output: 5 6 2… Read More »

## Check if a Binary Tree is BST : Simple and Efficient Approach

Given a Binary Tree, the task is to check whether the given binary tree is Binary Search Tree or not. A binary search tree (BST)… Read More »

## Calculate height of Binary Tree using Inorder and Level Order Traversal

Given Inorder traversal and Level Order traversal of a Binary Tree. The task is to calculate the height of the tree without constructing it. Example:… Read More »

## Print Binary Search Tree in Min Max Fashion

Given a Binary Search Tree (BST), the task is to print the BST in min-max fashion. What is min-max fashion? A min-max fashion means you… Read More »

## Find maximum and minimum element in binary tree without using recursion or stack or queue

Given a binary tree. The task is to find out the maximum and minimum element in a binary tree without using recursion or stack or… Read More »

## Reverse tree path using Queue

Given a tree and a node, the task is to reverse the path till the given Node and print the in-order traversal of the modified… Read More »

## Sum of the mirror image nodes of a complete binary tree in an inorder way

Given a complete binary tree, the task is to find the sum of mirror image nodes in an inorder way i.e. find the inorder traversal… Read More »

## Reverse alternate levels of a perfect binary tree using Stack

Given a Perfect Binary Tree, the task is to reverse the alternate level nodes of the binary tree. Examples: Input: a / \ b c… Read More »

## Check if the given binary tree has a sub-tree with equal no of 1’s and 0’s | Set 2

Given a tree having every node’s value as either 0 or 1, the task is to find whether the given binary tree contains any sub-tree… Read More »

## Find maximum among all right nodes in Binary Tree

Given a Binary Tree. The task is to find the maximum value among all of the right child nodes of the Binary Tree. Note: If… Read More »

## Print the nodes of binary tree as they become the leaf node

Given a binary tree. First print all leaf nodes, after that remove all the leaf nodes from the tree and now print all the new… Read More »

## Sort the path from root to a given node in a Binary Tree

Given a Binary tree, the task is to sort the particular path from to a given node of the binary tree. You are given a… Read More »

## DFS traversal of a tree using recursion

Given a Binary tree, Traverse it using DFS using recursion. Unlike linear data structures (Array, Linked List, Queues, Stacks, etc) which have only one logical… Read More »

## Arithmetic Expression Evalution

The stack organization is very effective in evaluating arithmetic expressions. Expressions are usually represented in what is known as Infix notation, in which each operator… Read More »

## Flatten a binary tree into linked list | Set-2

Given a binary tree, flatten it into a linked list. After flattening, the left of each node should point to NULL and right should contain… Read More »