Find height of the Binary Tree

 Given a Binary Tree, write code to calculate the height of the tree. Height of the binary Tree is the total number of levels in […]

Level of node in a Binary Tree

Given a Binary Tree and a pointer to the Node in that tree. Write a function to find level of Node in the Tree. For […]

Node with maximum value in a Binary search tree

Earlier, we have seen how to find the minimum element in a Binary Search Tree. Write a function which will return the maximum value in […]

Similar Trees

Write function to check whether two trees are similar or not. The signature of the function should be as shown below: /** * Function to […]

deleting a tree

Given a binary tree, write code to delete the entire tree. Structure of the node is as given below: struct Node { int data; Node* […]

Print ancestors of a node in a Binary Tree Node

Given a Binary tree and an integer, print all the ancestors of the node. For example: If the given tree is as below: Input: 5 […]

Level-wise traversal of a binary tree

Write an Algorithm to print the elements of a binary tree in level-wise order. For example if the Binary tree is as given below: Then […]

Diameter of a Tree

Diameter of a tree is the longest path (Number of nodes) between two leaf nodes of the tree. It is also called width of the […]

Number of nodes in a binary tree of height h

Given a binary tree of height ‘h’. What will be the minimum and maximum number of nodes in the tree?

Mirror of a Binary Tree

Given a Binary Tree, write a function which will convert that tree to its Mirror Tree. For Example: If the Binary Tree is 1 / […]