摘要: Given a binary tree, a target node in the binary tree, and an integer value k, print all the nodes that are at distance k from the given target node. ... 阅读全文
posted @ 2014-11-09 22:02 linyx 阅读(304) 评论(0) 推荐(0) 编辑
摘要: Given inorder and level-order traversals of a Binary Tree, construct the Binary Tree. Following is an example to illustrate the problem.BinaryTreeInpu... 阅读全文
posted @ 2014-11-09 19:59 linyx 阅读(336) 评论(0) 推荐(0) 编辑
摘要: Given a BST, transform it into greater sum tree where each node contains sum of all nodes greater than that node.自己想的复杂了,其实就是一个反向的inorder。新的值就是前面所有元素的... 阅读全文
posted @ 2014-11-09 14:23 linyx 阅读(151) 评论(0) 推荐(0) 编辑
摘要: Given a very large n-ary tree. Where the root node has some information which it wants to pass to all of its children down to the leaves with the cons... 阅读全文
posted @ 2014-11-09 00:47 linyx 阅读(606) 评论(0) 推荐(0) 编辑