Showing posts from December, 2013

Sum of nodes at each level of binary tree in Java

Topics covered 1. Sum of nodes at each level of binary tree 2. Complete sample program Problem Statement :- Find sum of nodes at each level of binary tree . Sum of nodes at each level of binary tree:-    12 41 66 232 Algorithm : Traver…

Zigzag level order traversal of binary tree in Java

Problem statement:- Traverse given binary tree alternatively left to right and right to left.In following diagram, LtoR represents : visit nodes from left to right in that level, similarly RtoL : visit nodes from right to left in that level. Read leve…

Find level with maximum sum in binary tree - display nodes and sum both

Problem statement :- For a given binary tree, find level with maximum sum and display all nodes at level level. For above binary tree: maximum sum recorded for 11, 991, 12  and maximum sum is 1014 Algorithm: - Do level order traversal with markin…

Load More
That is All