## Count subtrees that sum up to a given value x

Given a binary tree containing n nodes. The problem is to count subtress having total node’s data sum equal to a given value x. Examples:… Read More »

- MakeMyTrip Interview Experience 2019
- Print the nodes of binary tree as they become the leaf node
- Iterative Method To Print Left View of a Binary Tree
- Shannon-Fano Algorithm for Data Compression
- Count the Number of Binary Search Trees present in a Binary Tree
- Flatten a binary tree into linked list | Set-3
- Zig-Zag traversal of a Binary Tree using Recursion
- Difference between graph and tree
- Shortest root to leaf path sum equal to a given number
- Remove minimum elements from either side such that 2*min becomes more than max | Set 2
- Clockwise Spiral Traversal of Binary Tree
- Reverse zigzag Traversal of a Binary Tree
- Sum of nodes at maximum depth of a Binary Tree | Set 2
- Number of subarrays have bitwise OR >= K
- Check if the given Binary Tree have a Subtree with equal no of 1's and 0's
- Iterative Boundary traversal of Complete Binary tree
- Count all Grandparent-Parent-Child Triplets in a binary tree whose sum is greater than X
- Reverse Level Order traversal in spiral form
- Find the number of distinct pairs of vertices which have a distance of exactly k in a tree
- Building Expression tree from Prefix Expression
- Print All Leaf Nodes of a Binary Tree from left to right | Set-2 ( Iterative Approach )
- Spanning Tree With Maximum Degree (Using Kruskal's Algorithm)
- Sum of all odd nodes in the path connecting two given nodes
- Check if given Preorder, Inorder and Postorder traversals are of same tree | Set 2
- Print all the levels with odd and even number of nodes in it | Set-2
- Check if the given binary tree has a sub-tree with equal no of 1's and 0's | Set 2
- Range Sum Queries and Update with Square Root
- Sum of all the Boundary Nodes of a Binary Tree
- Determine the count of Leaf nodes in an N-ary tree
- Distribute candies in a Binary Tree

Given a binary tree containing n nodes. The problem is to count subtress having total node’s data sum equal to a given value x. Examples:… Read More »

Microsoft visited our campus. Prior to that, about a month ago they had conducted an online coding test. The interview consisted of 3 f2f rounds.… Read More »

Given a binary tree containing n nodes. The problem is to get the sum of all the leaf nodes which are at minimum level in… Read More »

Given a Binary Tree, find the deepest leaf node that is left child of its parent. For example, consider the following tree. The deepest left… Read More »

Write a function to print ZigZag order traversal of a binary tree. For the below binary tree the zigzag order traversal will be 1 3… Read More »

Given a tree represented as undirected graph. Count the number of nodes at given level l. It may be assumed that vertex 0 is root… Read More »

Talking about representation, trees can be represented in two way: 1) Dynamic Node Representation (Linked Representation). 2) Array Representation (Sequential Representation). We are going to… Read More »

I applied Off campus through Microsoft referral program. Initially the shortlisting was done on the basis of CV. Round 1: First round was Online coding… Read More »

Given the binary tree and you have to find out the n-th node of inorder traversal. Examples: Input : n = 4 10 / \… Read More »

N-ary tree refers to the rooted tree in which each node having atmost k child nodes. The diameter of n-ary tree is the longest path… Read More »

Consider lines of slope -1 passing between nodes. Given a Binary Tree, print all diagonal elements in a binary tree belonging to same line. Input… Read More »

This was a pool campus conducted by amazon for internship. Online Round: There were 20 mcq(+1 for each) and 2 coding questions(+30 for each). MCQ had… Read More »

Given a binary tree and a target integer x, delete all the leaf nodes having value as x. Also, delete the newly formed leaves with… Read More »

Construct a string consists of parenthesis and integers from a binary tree with the preorder traversing way. The null node needs to be represented by… Read More »

Given a skewed tree (Every node has at most one child) with N nodes and K colors. You have to assign a color from 1… Read More »