## Find the maximum sum leaf to root path in a Binary Tree

Given a Binary Tree, find the maximum sum path from a leaf to root.

Quick Links for Tree

Quizzes |

Given a Binary Tree, find the maximum sum path from a leaf to root.

Given a Binary Tree, find vertical sum of the nodes that are in same vertical line. Print all sums through different vertical lines.

Given a Binary Tree where each node has positive and negative values. Convert this to a tree where each node contains the sum of the… Read More »

Given a Binary Tree where each node has following structure, write a function to populate next pointer for all nodes.

Write a function to connect all the adjacent nodes at the same level in a binary tree. Structure of the given Binary Tree node is… Read More »

Given two binary trees, check if the first tree is subtree of the second one.

Write a function that returns true if the given Binary Tree is SumTree else false. A SumTree is a Binary Tree where the value of… Read More »

Minimum Spanning Tree (MST) problem: Given connected graph G with positive edge weights, find a min weight set of edges that connects all of the… Read More »

Given a Binary Tree and a key, write a function that prints all the ancestors of the key in the given binary tree.

Given a Binary Tree and a key, write a function that returns level of the key. For example, consider the following tree. If the input… Read More »

Difficulty Level: Rookie Why Tree? Unlike Array and Linked List, which are linear data structures, tree is hierarchical (or non-linear) data structure.

Given a root of a tree, and an integer k. Print all the nodes which are at k distance from root.

Question: Given a binary tree, find out if the tree can be folded or not. A tree can be folded if left and right subtrees… Read More »

Given a binary tree, write a function to get the maximum width of the given tree. Width of a tree is maximum of widths of… Read More »