上一页 1 ··· 12 13 14 15 16 17 18 19 20 ··· 22 下一页
摘要: QuestionGiven an array of non-negative integers, you are initially positioned at the first index of the array.Each element in the array represents you... 阅读全文
posted @ 2015-10-03 07:59 树獭君 阅读(229) 评论(0) 推荐(0)
摘要: CompanyMassMutualDate30/09/15LocationBoston, MAPositionApplication DeveloperIt's not a coding interview. The interviewer only asked me questions about... 阅读全文
posted @ 2015-10-01 07:22 树獭君 阅读(243) 评论(0) 推荐(0)
摘要: Postorder: first, visit left child, then, parent, last, is to visit right child.The postorder traversal result of above tree is {4,6,5,2,3,1}.Key diff... 阅读全文
posted @ 2015-10-01 06:45 树獭君 阅读(153) 评论(0) 推荐(0)
摘要: Preorder: first, visit parent node, then, left child, last is to visit right child.Algorithm 1 -- DFS & StackWe can use stack to store left child and ... 阅读全文
posted @ 2015-10-01 02:22 树獭君 阅读(184) 评论(0) 推荐(0)
摘要: QuestionThere are a total ofncourses you have to take, labeled from0ton - 1.Some courses may have prerequisites, for example to take course 0 you have... 阅读全文
posted @ 2015-10-01 00:05 树獭君 阅读(207) 评论(0) 推荐(0)
摘要: QuestionGiven a binary tree and a sum, find all root-to-leaf paths where each path's sum equals the given sum.For example:Given the below binary tree ... 阅读全文
posted @ 2015-09-30 23:24 树獭君 阅读(121) 评论(0) 推荐(0)
摘要: QuestionGiven a binary tree and a sum, determine if the tree has a root-to-leaf path such that adding up all the values along the path equals the give... 阅读全文
posted @ 2015-09-30 22:52 树獭君 阅读(156) 评论(0) 推荐(0)
摘要: QuestionGiven a binary tree, return all root-to-leaf paths.For example, given the following binary tree: 1 / \2 3 \ 5All root-to-leaf paths a... 阅读全文
posted @ 2015-09-30 05:00 树獭君 阅读(190) 评论(0) 推荐(0)
摘要: QuestionGiven a binary tree struct TreeLinkNode { TreeLinkNode *left; TreeLinkNode *right; TreeLinkNode *next; }Populate each nex... 阅读全文
posted @ 2015-09-29 10:38 树獭君 阅读(189) 评论(0) 推荐(0)
摘要: QuestionGiven a binary tree, determine if it is a valid binary search tree (BST).Assume a BST is defined as follows:The left subtree of a node contain... 阅读全文
posted @ 2015-09-29 09:27 树獭君 阅读(155) 评论(0) 推荐(0)
上一页 1 ··· 12 13 14 15 16 17 18 19 20 ··· 22 下一页