## Check if given Preorder, Inorder and Postorder traversals are of same tree | Set 2

Given Preorder, Inorder and Postorder traversals of some tree. The task is to check if they all are of the same tree. Examples: Input :… Read More »

## Find the kth node in vertical order traversal of a Binary Tree

Given a binary tree and an integer k, the task is to print the kth node in the vertical order traversal of binary tree.If no… Read More »

## Kth node in Diagonal Traversal of Binary Tree

Given a binary tree and a value K. The task is to print the k-th node in the diagonal traversal of the binary tree. If… Read More »

## Reverse Clockwise spiral traversal of a binary tree

Given a Binary Tree. The task is to print the circular reverse clockwise spiral order traversal of the given binary tree. Reverse Clockwise Traversal means… Read More »

## Create a mirror tree from the given binary tree

Given a binary tree, the task is to create a new binary tree which is a mirror image of the given binary tree. Examples: Input:… Read More »

## Print path between any two nodes in a Binary Tree

Given a Binary Tree of distinct nodes and a pair of nodes. The task is to find and print the path between the two given… Read More »

## Sum and Product of maximum and minimum element in Binary Tree

Given a Binary Tree. The task is to find the sum and product of maximum and minimum element in it. For example, sum of the… Read More »

## Print Sum and Product of all Non-Leaf nodes in Binary Tree

Given a Binary tree. The task is to find and print the product and sum of all internal nodes (non-leaf nodes) in the tree. In… Read More »

## Product of all nodes in a Binary Tree

Given a Binary Tree. The task is to write a program to find the product of all of the nodes of the given binary tree.… Read More »

## Print all even nodes of Binary Search Tree

Given a binary search tree. The task is to print all even nodes of the binary search tree. Examples: Input : 5 / \ 3… 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 »

## Preorder Traversal of N-ary Tree Without Recursion

Given an n-ary tree, print preorder traversal of it. Example : Preorder traversal of below tree is A B K N M J F D… Read More »

## Preorder from Inorder and Postorder traversals

Given Inorder and Postorder traversals of a binary tree, print Preorder traversal. Example: Input: Postorder traversal post[] = {4, 5, 2, 6, 3, 1} Inorder… Read More »

## Print nodes in top view of Binary Tree | Set 2

Top view of a binary tree is the set of nodes visible when the tree is viewed from the top. Given a binary tree, print… Read More »

## Sum of cousin nodes of a given node in a BST

Given a binary search tree and a number N, the task is to find the sum of the cousins of the given node N if… Read More »