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