Jan 052016
 

Given a Binary tree (not BST), write code to find the minimum and maximum value in the tree.
Binary TreeFor example, if the tree is as shown in the picture, then the output should be:

Minimum: 2
Maximum: 20

Continue reading »

Jun 182015
 

Given a Binary tree, write two function. The first function should write the binary tree in a file and second function should read the file and should be able to construct the same binary tree.

Here writing to file is not important, the important thing is to preserve the state of the Binary tree. Think of it like converting a binary tree to a String and then given that string, construct the same binary tree. Continue reading »