##
Find n-th node of inorder traversal
November 20, 2017

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

Quick Links for Tree

Quizzes |

November 20, 2017

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

November 16, 2017

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 »

November 15, 2017

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 »

November 11, 2017

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 »

November 10, 2017

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 »

November 9, 2017

Given a Binary Tree, find count of distinct nodes in a root to leaf path with maximum distinct nodes. Examples: Input : 1 / \… Read More »

November 6, 2017

Construct a binary tree from a string consisting of parenthesis and integers. The whole input represents a binary tree. It contains an integer followed by… Read More »

October 23, 2017

Given an array of size n. The problem is to check whether the given array can represent the level order traversal of a Binary Search… Read More »

October 17, 2017

Given a binary tree, replace each node with its depth value. For example, consider the following tree. Root is at depth 0, change its value… Read More »

October 16, 2017

Decision Tree : Decision tree is the most powerful and popular tool for classification and prediction. A Decision tree is a flowchart like tree structure,… Read More »

October 14, 2017

Count the number of Binary Tree possible for a given Preorder Sequence length n. Input : n = 1 Output : 1 Input : n… Read More »

October 12, 2017

Given a n-ary tree and a number x, find and return the number of nodes which are greater than x. Example: In the given tree,… Read More »

Given a generic tree and a integer x. Find and return the node with next larger element in the tree i.e. find a node just… Read More »

October 11, 2017

Given an N-ary tree, find and return the node with second largest value in the given tree. Return NULL if no node with required value… Read More »