摘要:
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... 阅读全文
摘要:
CompanyMassMutualDate30/09/15LocationBoston, MAPositionApplication DeveloperIt's not a coding interview. The interviewer only asked me questions about... 阅读全文
摘要:
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... 阅读全文
摘要:
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 ... 阅读全文
摘要:
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... 阅读全文
摘要:
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 ... 阅读全文
摘要:
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... 阅读全文
摘要:
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... 阅读全文
摘要:
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... 阅读全文