Monday, May 27, 2013

Tree and Graph Algorithm Questions


  1. Implement a function to check if binary tree is balanced. A balanced tree is whose left and right sub-tree height do not differ more than 1.
  2. Given a directed graph. Write algo to find route between 2 nodes.
  3. Given a sorted increasing order arrray. Create binary search tree with minimum height.
  4. Given a binary tree. Create a link list of all nodes at each depth.
  5. Write function which checks whether given binary tree is binary search tree.
  6. Write algo for next node "in order successor" of a given node in binary search tree.
  7. Write function of find common ancestor of 2 nodes. This may not be BST and avoid using other data structure.
  8. Given 2 very large binay tree. Find one tree is sub-tree of another at node N. So that if we cut tree at node N then both the tree are identical.
  9. Given the binary tree. Print all the paths whose sum is equal to gicen value. Path can start and end anywhere.

No comments: