## Print the first shortest root to leaf path in a Binary Tree

Given a Binary Tree with distinct values, the task is to print the first smallest root to leaf path. We basically need to print the… Read More »

## Print all internal nodes of a Binary tree

Given a Binary tree, the task is to print all the internal nodes in a tree. An internal node is a node which carries at… Read More »

## Reverse zigzag Traversal of a Binary Tree

Given a Binary Tree, the task is to print the Reverse zigzag Order of the tree. Examples: Input: 1 / \ 2 3 / \… Read More »

## Iterative Method To Print Left View of a Binary Tree

Given a Binary Tree, print it’s left view. Left view of a Binary Tree is a set of nodes visible when tree is seen from… Read More »

## Maximum number of leaf nodes that can be visited within the given budget

Given a binary tree and an integer b representing budget. The task is to find the count of maximum number of leaf nodes that can… Read More »

## Level Order Successor of a node in Binary Tree

Given a binary tree and a node in the binary tree, find Levelorder successor of the given node. That is, the node that appears after… Read More »

## Level Order Predecessor of a node in Binary Tree

Given a binary tree and a node in the binary tree, find Levelorder Predecessor of the given node. That is, the node that appears before… Read More »

## Right sibling of each node in a tree given as array of edges

Given a tree, with N nodes and E edges (every edge is denoted by two integers, X, Y stating that X is the parent of… Read More »

## Print nodes in the Top View of Binary Tree | Set 3

Top view of a binary tree is the set of nodes visible when the tree is viewed from the top. Given a binary tree, print… Read More »

## Iterative program to find distance of a node from root

Given the root of a binary tree and a key x in it, find the distance of the given key from the root node. Dis­tance… Read More »

## Create a tree in level order

Given an array of elements, the task is to insert these elements in level order and construct a tree. Input : arr[] = {10, 20,… Read More »

## Zig Zag Level order traversal of a tree using single queue

Write a function to print spiral order traversal of a tree. For below tree, function should print 1, 2, 3, 4, 5, 6, 7. Recommended:… Read More »

## Print nodes in top view of Binary Tree | Set 2

Top view of a binary tree is the set of nodes visible when the tree is viewed from the top. Given a binary tree, print… Read More »

## Sum of cousins of a given node in a Binary Tree

Given a binary tree and data value of a node. The task is to find the sum of cousin nodes of given node. If given… Read More »

## Print cousins of a given node in Binary Tree | Single Traversal

Given a binary tree and a node, print all cousins of given node. Note that siblings should not be printed. Examples: Input : root of… Read More »