## Sum of all the child nodes with even parent values in a Binary Tree

Given a binary tree, the task is to find the sum of all the nodes whose parent is even. Examples: Input: 1 / \ 3… Read More »

## Query to check if a range is made up of consecutive elements

Given an array of n non-consecutive integers and Q queries, the task is to check whether for the given range l and r, the elements… Read More »

## Construct XOR tree by Given leaf nodes of Perfect Binary Tree

Given the leaf nodes of a perfect binary tree, the task is to construct the XOR tree and print the root node of this tree.… Read More »

## Construct Binary Tree from Ancestor Matrix | Top Down Approach

Given an ancestor matrix mat[n][n] where the ancestor matrix is defined as below. mat[i][j] = 1 if i is ancestor of j mat[i][j] = 0,… Read More »

## Print left and right leaf nodes separately in Binary Tree

Given a binary tree, the task is to print left and right leaf nodes separately. Examples: Input: 0 / \ 1 2 / \ 3… Read More »

## Print characters and their frequencies in order of occurrence using Binary Tree

Given a string str containing only lowercase characters. The problem is to print the characters along with their frequency in the order of their occurrence… Read More »

## Prime Numbers present at Kth level of a Binary Tree

Given a number K, the task is to print the prime numbers present at that level given all the prime numbers are represented in the… Read More »

## Count of 1’s in any path in a Binary Tree

Given a binary tree of 0s and 1s, the task is to find the maximum number of 1s in any path in the tree. The… Read More »

## Remove vowels from a string stored in a Binary Tree

Given a binary tree in such a way such that the level order traversal of a binary tree produces a string S. The task is… Read More »

## Build Binary Tree from BST such that it’s level order traversal prints sorted data

Construct a Binary Tree from the given Binary Search Tree such that it’s level order traversal outputs sorted data. Examples: Input: Output: 1 2 3… Read More »

## Print path between any two nodes in a Binary Tree | Set 2

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 »

## Minimum count of Full Binary Trees such that the count of leaves is N

Given an integer N and an infinite number of Full Binary Trees of different depths, the task is to choose minimum number of trees such… Read More »

## Difference between Binary tree and B-tree

B-Tree : B-Tree is known as self-balancing tree as its nodes are sorted in inorder traversal. Unlike binary tree, in B-tree, a node can have… Read More »

## Sum of lengths of all paths possible in a given tree

Given a tree with N nodes, the task is to find the sum of lengths of all the paths. Path length for two nodes in… Read More »

## Queries to check if the path between two nodes in a tree is a palindrome

Given a tree with N nodes and N – 1 edges. Each edge of the tree is labeled by a string of lowercase english alphabets.… Read More »