Given a Binary Search Tree (BST)consisting of N nodes and two nodes A and B, the task is to find the median of all the… Read More

# Category Archives: Tree

Given an N-ary tree consisting of N nodes, the task is to find the node having the largest value in the given N-ary Tree. Examples:… Read More

Given a Binary Search Tree consisting of N nodes and two positive integers L and R, the task is to find the sum of values… Read More

Given a Binary Tree consisting of N nodes having distinct values from the range [1, N], the task is to find the lowest common ancestor… Read More

Given a Binary Tree consisting of N nodes and two integers K and L, the task is to add one row of nodes of value… Read More

Given a Binary Tree consisting of N nodes, the task is to find the number of paths from the root to any node X, such… Read More

The tree is a hierarchical Data Structure. A binary tree is a tree that has at most two children. The node which is on the… Read More

Given a Binary Tree consisting of N nodes, the task is to print the Level Order Traversal after replacing the value of each node with… Read More

Given a Directed Tree consisting of N nodes, the task is to check if there exists a node in the given tree such that all… Read More

Given a positive integer H, the task is to find the number of possible Binary Search Trees of height H consisting of the first (H… Read More

Given a binary tree consisting of N nodes, the task is to replace each node in the binary tree with the sum of its preorder… Read More

Given a Binary Tree, the task is to modify the Tree by left rotating every node any number of times such that every level consists… Read More

Given an array arr[] consisting of N non-negative integers and a 2D array queries[][] consisting of queries of the type {X, M}, the task for… Read More

Given an N-ary tree consisting of N nodes numbered from 1 to N rooted at node 1, the task is to assign values to each… Read More

Given an array arr[] consisting of N integers, an integer X, and a 2D array queries[][] consisting of queries of the following two types: (L,… Read More