- 博客(7)
- 收藏
- 关注
原创 [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
原创 [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
原创 [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
原创 [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
原创 [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
原创 [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
原创 [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
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人