
DFS
文章平均质量分 62
hling_so
这个作者很懒,什么都没留下…
展开
专栏收录文章
- 默认排序
- 最新发布
- 最早发布
- 最多阅读
- 最少阅读
-
133. Clone Graph
Clone an undirected graph原创 2017-10-05 14:29:11 · 213 阅读 · 0 评论 -
332. Reconstruct Itinerary
332. Reconstruct Itinerary原创 2017-10-15 22:18:42 · 217 阅读 · 0 评论 -
399. Evaluate Division
399. Evaluate Division原创 2017-10-20 13:44:08 · 310 阅读 · 0 评论 -
638. Shopping Offers
题目题意不同的商品i有不同需求needs[i] 有些特价组合special[],对应每一种商品i有相应的数量,买相应的数量就可以用组合价(但是有一些组合未必会比单买便宜) 求恰好买够需求needs[]的的最低总价.分析用动态规划+DFS 每一次调用遍历一次组合special[i], 看剩余的需求里面能不能用组合i的方式购买,如果可以,则使用组合i,并且减去相应的need的数量,剩余的数量再调用原创 2017-12-24 23:51:00 · 426 阅读 · 0 评论 -
100. Same Tree
题目Given two binary trees, write a function to check if they are the same or not.Two binary trees are considered the same if they are structurally identical and the nodes have the same value.Example 1:I原创 2017-12-25 20:32:07 · 185 阅读 · 0 评论 -
695. Max Area of Island
题目Given a non-empty 2D array grid of 0’s and 1’s, an island is a group of 1’s (representing land) connected 4-directionally (horizontal or vertical.) You may assume all four edges of the grid are surro原创 2017-12-28 19:55:39 · 174 阅读 · 0 评论