##
Level Order Tree Traversal
November 7, 2009

Level order traversal of a tree is breadth first traversal for the tree.

November 7, 2009

Level order traversal of a tree is breadth first traversal for the tree.

August 15, 2009

Asked by Varun Bhatia. Question: Write a recursive function treeToList(Node root) that takes an ordered binary tree and rearranges the internal pointers to make a… Read More »

August 9, 2009

Given values of two values n1 and n2 in a Binary Search Tree, find the Lowest Common Ancestor (LCA). You may assume that both the… Read More »

Asked by Varun Bhatia Here is the solution.

August 2, 2009

It depends on what traversals are given. If one of the traversal methods is Inorder then the tree can be constructed, otherwise not.

June 27, 2009

Mirror of a Tree: Mirror of a Binary Tree T is another Binary Tree M(T) with left and right children of all non-leaf nodes interchanged.

To delete a tree we must traverse all the nodes of the tree and delete them one by one. So which traversal we should use… Read More »

Given a binary tree, find height of it. Height of empty tree is 0 and height of below tree is 3.

June 26, 2009

Two trees are identical when they have same data and arrangement of data is also same.

June 23, 2009

Size of a tree is the number of elements present in the tree. Size of the below tree is 5.

Unlike linear data structures (Array, Linked List, Queues, Stacks, etc) which have only one logical way to traverse them, trees can be traversed in different… Read More »