Given a Binary Tree, extract all leaves of it in a Doubly Linked List (DLL).
Given a binary tree, a complete path is defined as a path from root to a leaf. The sum of all nodes on that path… Read More »
Given a Binary Tree, print left view of it. Left view of a Binary Tree is set of nodes visible when tree is visited from… Read More »
Given a Binary Tree, check if all leaves are at same level or not.
Write a C code to get the depth of the deepest odd level leaf node in a binary tree. Consider that level starts with 1.
Given Inorder and Preorder traversals of a binary tree, print Postorder traversal.
Given a a Binary Tree, find the difference between the sum of nodes at odd level and the sum of nodes at even level. Consider… Read More »
Given a Binary Tree (BT), convert it to a Doubly Linked List(DLL). The left and right pointers in nodes are to be used as previous… Read More »
You are given a set of links, e.g. a —> b b —> c b —> d a —> e Print the tree that would… Read More »
There are two conventions to define height of Binary Tree 1) Number of nodes on longest path from root to the deepest node. 2) Number… Read More »
Write a function to detect if two trees are isomorphic. Two trees are called isomorphic if one of them can be obtained from other by… Read More »
Given a Binary Tree (Bt), convert it to a Doubly Linked List(DLL). The left and right pointers in nodes are to be used as previous… Read More »
Trees: Unlike Arrays, Linked Lists, Stack and queues, which are linear data structures, trees are hierarchical data structures.
Given Linked List Representation of Complete Binary Tree, construct the Binary tree. A complete binary tree can be represented in an array in the following… Read More »
We have discussed level order traversal of a post in previous post. The idea is to print last level first, then second last level, and… Read More »