摘要: Given keys and frequency at which these keys are searched, how would you create a binary search tree from these keys such that the cost of searching i 阅读全文
posted @ 2017-08-16 14:14 Review->Improve 阅读(588) 评论(0) 推荐(0) 编辑
摘要: Write a program to delete a tree. Solution. To delete all tree nodes, we need to set all non-leaf nodes' children nodes to null. So for a given non-le 阅读全文
posted @ 2017-08-16 09:53 Review->Improve 阅读(152) 评论(0) 推荐(0) 编辑
摘要: Write a function to detect if two trees are isomorphic. Two trees are called isomorphic if one of them can be obtained from other by a series of flips 阅读全文
posted @ 2017-08-16 09:42 Review->Improve 阅读(268) 评论(0) 推荐(0) 编辑
摘要: Given a binary tree, where every node value is a number . Find the sum of all the numbers which are formed from root to leaf paths. For example consid 阅读全文
posted @ 2017-08-16 03:25 Review->Improve 阅读(210) 评论(0) 推荐(0) 编辑