Tag Archives: binary tree

Binary Search Tree in Binary Tree

Given a binary tree, find the largest binary SEARCH tree in this binary tree.

When I mean largest, the tree with maximum number of nodes. And the binary search tree should be a sub-tree in the given binary tree.

Note: Not every binary tree is a binary search tree 😛


Posted by on August 13, 2010 in Algorithms


Tags: , ,

Interview Question : Print nodes of a Binary Tree level order from leaves to root

I think most of you might know about Breadth First Search (BFS), in which you print nodes of a tree from root to leaves. Now there is a small change to the way the nodes are printed. Lets say given a binary tree, I want the nodes to be printed level order but from leaves to root

Eg :  consider the binary tree at this locations

Now you need to print : 5 11 4 2 6 9 7 5 2


Posted by on May 8, 2010 in Algorithms


Tags: , , ,