Saturday, 5 July 2014

Algorithms- Things to Remember

  1. Height of a node is number of edges on longest path from node to leaf.Height of leaf is 0.
  2. Depth of a node is number of edges from node to root of the tree. Depth of root is 0.           
  3.  Maximum number of edges that can exist in Directed Acyclic Graph is n(n-1)/2
  4.  Insertion into BST  takes O(nlogn) time.


      



No comments:

Post a Comment