Freshman
L丶K丶
这个作者很懒,什么都没留下…
展开
-
[LeetCode] [C++] 62. Unique Paths
There are numbers in each grid in the picture,which stand for the number of unique paths from Start to the grid.Observing the picture,we can easily find that,for any i,j>0,dp[i][j]=dp[i-原创 2017-12-09 14:00:58 · 160 阅读 · 0 评论 -
[LeetCode] [C] 48. Rotate Image
Looking at the input matrix and the output matrix,we can easily find that it rotates 90° clockwise.And I implement that by rotating every "circle" of it.First I rotate the outmost circle,原创 2017-11-28 16:15:32 · 183 阅读 · 0 评论 -
[LeetCode] [C++] 20. Valid Parentheses
I used the data structure "Stack" here,which is convenient to solve this problem.When the parenthesis is a left parenthesis,I push it into the stack.And when the parenthesis is a right par原创 2017-11-22 21:47:50 · 164 阅读 · 0 评论 -
[LeetCode] [C] 100. Same Tree
To solve the problem about Binary Tree,I still used Recursive Method.Here, I still wrote another function to help traverse.And I still declared the variable outside the two functions.S原创 2017-11-21 22:59:42 · 241 阅读 · 0 评论 -
[LeetCode] [C] 104. Maximum Depth of Binary Tree
Talking about Binary Tree,I will often think of Recursion.To traverse the binary tree,I always use Recursive Method.So here, to find the maximum depth of binary tree,I wrote another fu原创 2017-11-21 22:44:31 · 225 阅读 · 0 评论 -
[LeetCode] [C++] 515. Find Largest Value in Each Tree Row
When seeing this problem,which let us find something in each tree row,I thought I could solve this problem by using "Level-order Traversal".The code is as follows.The Runti原创 2017-11-21 22:31:04 · 174 阅读 · 0 评论 -
[LeetCode] [C] 41. First Missing Positive
In this program,I used Bubble Sortto sort the array first.Then, I declared a variable "count" to represent the First Missing Positive Integer.(Because the way I used it is similar to when I am原创 2017-11-21 23:44:39 · 177 阅读 · 0 评论