# Tag Archives: Binary Tree

## Print the nodes of Binary Tree having a grandchild

Given a Binary Tree, the task is to print the nodes that have grandchildren. Examples: Input: Output: 20 8 Explanation: 20 and 8 are the… Read More »

## Check if the Binary Tree contains a balanced BST of size K

Given a Binary Tree and a positive integer K. The task is to check whether the Balanced BST of size K exist in a given… Read More »

## Print the longest path from root to leaf in a Binary tree

Given a binary tree, the task is to print the longest path from the root node to the leaf node. If there are multiple answers… Read More »

## Count of paths in given Binary Tree with odd bitwise AND for Q queries

Given an integer Q representing the number of queries and an array where each query has an integer N. Our task is to iterate through… Read More »

## Check if max sum level of Binary tree divides tree into two equal sum halves

Given a Binary Tree, the task is to check if the maximum sum level divides the binary tree into the two parts of two equal… Read More »

## Double Threaded Binary Search Tree

Double Threaded Binary Search Tree: is a binary search tree in which the nodes are not every left NULL pointer points to its inorder predecessor… Read More »

## Create Balanced Binary Tree using its Leaf Nodes without using extra space

Prerequisites: Binary Tree to Doubly Linked List Given a Binary Tree, the task is create a Balanced Binary Tree from all the leaf nodes of… Read More »

## Min-Max Product Tree of a given Binary Tree

Given a Binary Tree, the task is to convert the given Binary tree into Min-Max Product Tree and print the level-order sequence of the modified… Read More »

## Check if all nodes of the Binary Tree can be represented as sum of two primes

Given a binary tree of N nodes with odd value. The task is to check whether all the nodes of the tree can be represented… Read More »

## Find parent of given node in a Binary Tree with given postorder traversal

Given two integers N and K where N denotes the height of a binary tree, the task is to find the parent of the node… Read More »

## Maximum absolute difference between any two level sum in a Binary Tree

Given a Binary Tree having positive and negative nodes, the task is to find the maximum absolute difference of level sum in it. Examples: Input:… Read More »

## Print K inorder successors of a Binary Tree in O(1) space

Given a Binary Tree and two numbers P and K, the task is to print the K Inorder Successor of the given number P from… Read More »

## Count of root to leaf paths whose permutation is palindrome in a Binary Tree

Given a binary tree where node contains characters, the task is to count the number of paths from root vertex to leaf such that at… Read More »

## Check if Inorder traversal of a Binary Tree is palindrome or not

Given a binary tree and the task if to check if its Inorder Sequence is a palindrome or not. Examples: Input: Output: True Explanation: The… Read More »

## Find distance between two nodes in the given Binary tree for Q queries

Given a binary tree having N nodes and weight of N-1 edges. The distance between two nodes is the sum of the weight of edges… Read More »