Serialization/Deserialization- I - -Saving a BST to a file
http://www.leetcode.com/2010/09/saving-binary-search-tree-to-file.html
Serialization/Deserialization- II - -Saving a BT to a file
http://www.leetcode.com/2010/09/saving-binary-search-tree-to-file.html
Serialization/Deserialization- II - -Saving a BT to a file
int diameter(struct node *t){
ReplyDeleteif(t==NULL) return 0;
return max( height(t->left) + height(t->right) +1 , max(diameter(t->left), diameter(t->right)) );
}