摘要: leetcode -Invert Binary Treenvert a binary tree. 4 / \ 2 7 / \ / \1 3 6 9to 4 / \ 7 2 / \ / \9 6 3 1/** * Defini... 阅读全文
posted @ 2015-08-20 23:40 cnblogshnj 阅读(111) 评论(0) 推荐(0) 编辑
摘要: leetcode - Lowest Common Ancestor of a Binary Search TreeGiven a binary search tree (BST), find the lowest common ancestor (LCA) of two given nodes in... 阅读全文
posted @ 2015-08-20 23:23 cnblogshnj 阅读(143) 评论(0) 推荐(0) 编辑
摘要: leetcode -Minimum Path SumGiven amxngrid filled with non-negative numbers, find a path from top left to bottom right whichminimizesthe sum of all numb... 阅读全文
posted @ 2015-08-20 16:05 cnblogshnj 阅读(157) 评论(0) 推荐(0) 编辑
摘要: leetcode -Unique PathsA robot is located at the top-left corner of amxngrid (marked 'Start' in the diagram below).The robot can only move either down ... 阅读全文
posted @ 2015-08-20 14:58 cnblogshnj 阅读(142) 评论(0) 推荐(0) 编辑
摘要: leetcode -Climbing StairsYou are climbing a stair case. It takesnsteps to reach to the top.Each time you can either climb 1 or 2 steps. In how many di... 阅读全文
posted @ 2015-08-20 13:17 cnblogshnj 阅读(113) 评论(0) 推荐(0) 编辑
摘要: leetcode - Maximum SubarrayFind the contiguous subarray within an array (containing at least one number) which has the largest sum.For example, given ... 阅读全文
posted @ 2015-08-20 11:46 cnblogshnj 阅读(115) 评论(0) 推荐(0) 编辑
摘要: leetcode -Unique Binary Search TreesGivenn, how many structurally uniqueBST's(binary search trees) that store values 1...n?For example,Givenn= 3, ther... 阅读全文
posted @ 2015-08-20 11:23 cnblogshnj 阅读(112) 评论(0) 推荐(0) 编辑