## Level order traversal in spiral form | Using Deque

Given a Binary Tree, the task is to print spiral order traversal of the given tree. For below tree, the function should print 1, 2,… Read More »

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

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

## Check whether the given node is in the path between the nodes U and V

Given three vertices U, V and R of a binary tree, the task is to check whether R lies in the path between U and… Read More »

## Vertical Zig-Zag traversal of a Tree

Given a Binary Tree, the task is to print the elements in the Vertical Zig-Zag traversal order. Vertical Zig-Zag traversal of a tree is defined… Read More »