# Category Archives: Tree (adsbygoogle = window.adsbygoogle || []).push({});

## Find the node whose absolute difference with X gives maximum value

Given a tree, and the weights of all the nodes and an integer x, the task is to find a node i such that |weight[i]… Read More »

## Find the node whose xor with x gives maximum value

Given a tree, and the weights of all the nodes and an integer x, the task is to find a node i such that weight[i]… Read More »

## Adobe Interview Experience ( 3 Years Exp )

I was called to Noida office of Adobe situated in sector 132 Noida. Round 1: Remove half nodes from a binary tree. (Half Nodes =… Read More »

## GCD from root to leaf path in an N-ary tree

Given an N-ary tree and an array val[] which stores the values associated with all the nodes. Also given are a leaf node X and… Read More »

## Find the number of different numbers in the array after applying the given operation q times

Given an array of size N, initially consists of zeroes only. The task is to apply given operation q times and find the number of… Read More »

## Sum of the mirror image nodes of a complete binary tree in an inorder way

Given a complete binary tree, the task is to find the sum of mirror image nodes in an inorder way i.e. find the inorder traversal… Read More »

## K-th ancestor of a node in Binary Tree | Set 3

Given a binary tree in which nodes are numbered from 1 to N. Given a node and a positive integer K. We have to print… Read More »

## B-Tree Insert without aggressive splitting

B-Tree Insert without aggressive splitting This algorithm for insertion takes an entry, finds the leaf node where it belongs, and inserts it there. We recursively… Read More »

## Find the largest Complete Subtree in a given Binary Tree

Given a Binary Tree, the task is to find the size of largest Complete sub-tree in the given Binary Tree. Complete Binary Tree – A… Read More »

## Index of kth set bit in a binary array with update queries

Given a binary array arr[] and q queries of following types: k: find the index of the kth set bit i.e. kth 1 in the… Read More »

## Check if given Preorder, Inorder and Postorder traversals are of same tree | Set 2

Given Preorder, Inorder and Postorder traversals of some tree. The task is to check if they all are of the same tree. Examples: Input :… Read More »

## Iterative Postorder traversal | Set 3

We have seen different ways of performing postorder traversal on Binary Trees. Post Order Traversal. Iterative Postorder Traversal using Two Stacks. Iterative Postorder Traversal using… Read More »

## Find the largest Perfect Subtree in a given Binary Tree

Given a Binary Tree, the task is to find the size of largest Perfect sub-tree in the given Binary Tree. Perfect Binary Tree – A… Read More »

## XOR of all the nodes in the sub-tree of the given node

Given an n-ary tree and Q queries where each query consists of an integer u which denotes a node. The task is to print the… Read More »

## Find all the pairs with given sum in a BST | Set 2

Given a Binary Search Tree and an integer sum, the task is to find all the pairs from the tree whose sum is equal to… Read More »