摘要: Description:Given a triangle, find the minimum path sum from top to bottom. Each step you may move to adjacent numbers on the row below.For example, g... 阅读全文
posted @ 2015-06-20 16:25 Rosanne 阅读(230) 评论(0) 推荐(0) 编辑
摘要: Description:Given an indexk, return thekthrow of the Pascal's triangle.For example, givenk= 3,Return[1,3,3,1].Note:Could you optimize your algorithm t... 阅读全文
posted @ 2015-06-20 16:19 Rosanne 阅读(180) 评论(0) 推荐(0) 编辑
摘要: Description:GivennumRows, generate the firstnumRowsof Pascal's triangle.For example, givennumRows= 5,Return[ [1], [1,1], [1,2,1], [1,3,3,1],... 阅读全文
posted @ 2015-06-20 16:17 Rosanne 阅读(208) 评论(0) 推荐(0) 编辑
摘要: Description:Follow up for problem "Populating Next Right Pointers in Each Node".What if the given tree could be any binary tree? Would your previous s... 阅读全文
posted @ 2015-06-20 15:49 Rosanne 阅读(196) 评论(0) 推荐(0) 编辑
摘要: Description:Given a binary tree struct TreeLinkNode { TreeLinkNode *left; TreeLinkNode *right; TreeLinkNode *next; }Populate each... 阅读全文
posted @ 2015-06-20 15:48 Rosanne 阅读(181) 评论(0) 推荐(0) 编辑
摘要: Description:Given 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 ... 阅读全文
posted @ 2015-06-20 15:40 Rosanne 阅读(177) 评论(0) 推荐(0) 编辑
摘要: Description:Given a binary tree, find its minimum depth.The minimum depth is the number of nodes along the shortest path from the root node down to th... 阅读全文
posted @ 2015-06-20 15:36 Rosanne 阅读(155) 评论(0) 推荐(0) 编辑
摘要: Description:Given a binary tree, determine if it is height-balanced.For this problem, a height-balanced binary tree is defined as a binary tree in whi... 阅读全文
posted @ 2015-06-20 15:29 Rosanne 阅读(159) 评论(0) 推荐(0) 编辑
摘要: Description:Given a binary tree, return thebottom-up level ordertraversal of its nodes' values. (ie, from left to right, level by level from leaf to r... 阅读全文
posted @ 2015-06-20 15:22 Rosanne 阅读(186) 评论(0) 推荐(0) 编辑
摘要: Description:Given inorder and postorder traversal of a tree, construct the binary tree.Note:You may assume that duplicates do not exist in the tree.Co... 阅读全文
posted @ 2015-06-20 15:21 Rosanne 阅读(180) 评论(0) 推荐(0) 编辑
摘要: Description:Given preorder and inorder traversal of a tree, construct the binary tree.Note:You may assume that duplicates do not exist in the tree.Cod... 阅读全文
posted @ 2015-06-20 15:19 Rosanne 阅读(177) 评论(0) 推荐(0) 编辑
摘要: Description:Given a binary tree, find its maximum depth.The maximum depth is the number of nodes along the longest path from the root node down to the... 阅读全文
posted @ 2015-06-20 15:12 Rosanne 阅读(124) 评论(0) 推荐(0) 编辑