Longest consecutive path in a Binary tree

Given a Binary tree, write code to find the length of longest path such that value of node in that path are consecutive and in decreasing […]

Sum of all nodes at a vertical level

Given a binary tree and a number n representing the vertical level. Write code to compute the sum of all nodes which are at vertical […]

Vertical distance of a Node from root

Given a Binary Tree and a Node, Write a function that return the vertical distance of that node from root of the tree. The vertical […]

Check if a subtree exist with a given sum

Given a binary tree and a Number N, write code to check if there exist a subtree of the Binary tree with sum of all […]

Binary Heap

Binary heap is used to implement Priority queue. It is an array object, visualized as an almost complete binary tree. Binary heap comes in two flavours Max-Heap Min-Heap A […]

Count all left nodes in a Binary tree

One way to ask this question is: Given a Binary tree that represent a family hierarchy. A parent can have at most two children (at most […]

Check if a Binary Tree is Complete Binary Tree – Video

This is video discussion of a typical interview problem to check if the given Binary tree is a complete Binary tree or not.

Check if all leaf nodes are at the same level – video

This is the video of a typical interview problem to Check if all leaf nodes in a Binary tree are at the same level.

Check if all leaf nodes are at the same level

Given a binary tree write a function to check if all leaf nodes of the tree are at the same level. For example, In all […]

Check if a Binary Tree is Complete Binary Tree

A Complete Binary Tree is a Binary Tree where each level is completely filled. For example, all the trees below are complete Binary trees Height=1 […]