## Find Vertical Sum in a given Binary Tree

Given a binary tree, print vertical sum of it. Assume, the left and right child of a node makes 45 degree angle with the parent. Get great deals at Amazon

Coding made easy

Binary Trees

Given a binary tree, print vertical sum of it. Assume, the left and right child of a node makes 45 degree angle with the parent. Get great deals at Amazon

Given a binary tree, determine the distance between given pairs of nodes in it. Distance between two nodes is defined as the number of edges in shortest path from one node from other.

Given a binary tree, find all ancestors of given node in it.

Given a binary tree, write an efficient algorithm to print all paths from root node to every leaf node in it.

Given a binary tree and two nodes x and y in it, find lowest common ancestor (LCA) of x and y in it.

Given a binary tree, write iterative and recursive solution to traverse the tree using in-order traversal in C++ and Java. Unlike linked lists, one-dimensional arrays and other linear data structures, which are traversed in linear order, trees may be traversed in multiple ways in depth-first order (pre-order, in-order, and post-order) or breadth-first order (level …

Given a binary tree, write iterative and recursive solution to traverse the tree using pre-order traversal in C++ and Java. Unlike linked lists, one-dimensional arrays and other linear data structures, which are traversed in linear order, trees may be traversed in multiple ways in depth-first order (pre-order, in-order, and post-order) or breadth-first order …

Given a binary tree, write iterative and recursive solution to traverse the tree using post-order traversal in C++ and Java. Unlike linked lists, one-dimensional arrays and other linear data structures, which are traversed in linear order, trees may be traversed in multiple ways in depth-first order (pre-order, in-order, and post-order) or breadth-first order …

Given a binary tree, write an efficient algorithm to determine if it can be converted to another binary tree by doing any number of swaps of its right and left branches.

Given a binary tree, write an efficient algorithm to convert binary tree to its mirror.

Given a binary tree, write an efficient algorithm to check if it is symmetric binary tree or not. i.e. left subtree and right subtree are mirror images or each other.

Given a binary tree, write an efficient algorithm to compute the diameter of it. The diameter of a binary tree is equal to number of nodes on the longest path between any two leaves in it.