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

## Level order traversal with direction change after every two levels | Recursive Approach

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 »

## Postorder successor of a Node in Binary Tree

Given a binary tree and a node in the binary tree, find Postorder successor of the given node. Examples: Consider the following binary tree 20… Read More »

## Traversal of tree with k jumps allowed between nodes of same height

Consider a tree with n nodes and root. You can jump from one node to any other node on the same height a maximum of… Read More »

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

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

## Check if two nodes are cousins in a Binary Tree

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