## Sum of leaf nodes at minimum level

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 »

Quick Links for Tree

Quizzes |

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 »

iven 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 »

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 »

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

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 »

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 »

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 »