# Tag Archives: Preorder Traversal

## Remove nodes from Binary Tree such that sum of all remaining root-to-leaf paths is atleast K

Given a Binary Tree and an integer K, the task is to delete nodes from the given Tree such that the sum of all nodes… Read More »

## Print all root-to-leaf paths with maximum count of even nodes

Given a Binary tree, the task is to print all possible root-to-leaf paths having a maximum number of even valued nodes. Examples: Input:  2 /… Read More »

## Count nodes having smallest value in the path from root to itself in a Binary Tree

Given a Binary Tree, the task is to count the number of nodes in the given Binary Tree such that the path from the root… Read More »

## Count root to leaf paths having exactly K distinct nodes in a Binary Tree

Given a Binary Tree consisting of N nodes rooted at 1, an integer K and an array arr[] consisting of values assigned to each node,… Read More »

## Mix Order Traversal of a Binary Tree

Given a Binary Tree consisting of N nodes, the task is to print its Mix Order Traversal.   Mix Order Traversal is a tree traversal technique,… Read More »

## Construct a Maximum Binary Tree from two given Binary Trees

Given two Binary Trees, the task is to create a Maximum Binary Tree from the two given binary trees and print the Inorder Traversal of… Read More »

## Find maximum GCD value from root to leaf in a Binary tree

Given a Binary Tree, the task is to find the maximum value of GCD from any path from the root node to the leaf node.… Read More »

## Check whether every node of binary tree has a value K on itself or its any immediate neighbours

Given a binary tree and a value K, the task is to check if every node of the binary tree has either value of the… Read More »

## Print the nodes that are just above the leaf node

Given a binary tree consisting of N nodes, the task is to print the nodes that are just above the leaf node.Examples: Input: N =… Read More »

## Count of Fibonacci paths in a Binary tree

Given a Binary Tree, the task is to count the number of Fibonacci paths in the given Binary Tree. Fibonacci Path is a path which… Read More »

## Check if a binary tree is subtree of another binary tree using preorder traversal : Iterative

Given two binary trees S and T, the task is the check that if S is a subtree of the Tree T.For Example:  Input: Tree… Read More »

## Find Leftmost and Rightmost node of BST from its given preorder traversal

Given a preorder sequence of the binary search tree of N nodes. The task is to find its leftmost and rightmost node. Examples: Input :… Read More »

## Sum of all parent-child differences in a Binary Tree

Given a binary tree, find the sum of all parent-child differences for all the non-leaf nodes of the given binary tree. Note that parent-child difference… Read More »

## Connect all nodes to their Left Neighbors in a Binary Tree

Given a Binary Tree, where each node contains an extra empty pointer initially null. The task is to connect all nodes of the binary tree… Read More »

## Search a node in Binary Tree

Given a Binary tree and a node. The task is to search and check if the given node exists in the binary tree or not.… Read More »