algorithm001 / algorithm

119 stars 152 forks source link

算法训练营第三周作业 #299

Open GeekUniversity opened 5 years ago

GeekUniversity commented 5 years ago

本周重点学习知识点

递归树、堆和排序、图、深度和广度优先搜索、字符串匹配

要求

  1. 每周至少完成给定题目中的两道算法题
  2. 围绕每周重点学习的算法知识点,撰写一篇有观点和思考的技术文章(字数不限)

注意事项

  1. 下面列出的题目中,按照知识点进行了简单分类,但并不意味着使用相应的数据结构或算法一定是解决该题目的最优解,这样分类只是为了方便大家有针对性的练习;
  2. 有的题目可能需要结合多个算法或数据结构进行求解。

第三周题目

简单:https://leetcode-cn.com/problems/find-the-town-judge/ 中等:https://leetcode-cn.com/problems/course-schedule-ii 困难:https://leetcode-cn.com/problems/minimize-malware-spread-ii/

堆和排序

简单:https://leetcode-cn.com/problems/kth-largest-element-in-a-stream/ 中等:https://leetcode-cn.com/problems/find-k-pairs-with-smallest-sums/ 困难:https://leetcode-cn.com/problems/find-median-from-data-stream/

DFS

简单:https://leetcode-cn.com/problems/maximum-depth-of-binary-tree/ 中等:https://leetcode-cn.com/problems/number-of-islands/ 中等:https://leetcode-cn.com/problems/find-eventual-safe-states/ 困难:https://leetcode-cn.com/problems/longest-increasing-path-in-a-matrix/ 困难:https://leetcode-cn.com/problems/making-a-large-island/

BFS

简单:https://leetcode-cn.com/problems/n-ary-tree-level-order-traversal/ 中等:https://leetcode-cn.com/problems/minesweeper/ 中等:https://leetcode-cn.com/problems/minimum-height-trees/ 困难:https://leetcode-cn.com/problems/bus-routes/

作业提交规则

  1. 在提交作业之前,请先阅读这里的 README 文档:https://github.com/algorithm001/algorithm/blob/master/README.md
  2. 然后在此 Issues 下按照如下格式回复:
  1. 学号 + GitHub Username
  2. 作业代码的 GitHub 链接(填写自己仓库下对应的作业链接即可,同时记得给本仓库提交 pull request)
  3. 发表自己本周的学习感言 issues,并提交链接,issues 标题格式:“【学号后三位-week2】+文章标题”,格式参考:https://github.com/algorithm001/algorithm/issues/9
myrichhub commented 5 years ago

学号:028 Username:myrichhub 第三周作业链接:https://github.com/myrichhub/algorithm/tree/master/Week_03/id_28 学习感言: https://github.com/algorithm001/algorithm/issues/479

ericyang89 commented 5 years ago

学号:023 Username:ericyang89 第三周作业链接:https://github.com/ericyang89/algorithm/tree/master/Week_03/id_23 学习感言: #480 编程语言:JavaScript

Fanlu91 commented 5 years ago

第三周题目

简单:https://leetcode.com/problems/find-the-town-judge/ 中等:https://leetcode.com/problems/course-schedule-ii 困难:https://leetcode.com/problems/minimize-malware-spread-ii/

堆和排序

简单:https://leetcode.com/problems/kth-largest-element-in-a-stream/ 中等:https://leetcode.com/problems/find-k-pairs-with-smallest-sums/ 困难:https://leetcode.com/problems/find-median-from-data-stream/

DFS

简单:https://leetcode.com/problems/maximum-depth-of-binary-tree/ 中等:https://leetcode.com/problems/number-of-islands/ 中等:https://leetcode.com/problems/find-eventual-safe-states/ 困难:https://leetcode.com/problems/longest-increasing-path-in-a-matrix/ 困难:https://leetcode.com/problems/making-a-large-island/

BFS

简单:https://leetcode.com/problems/n-ary-tree-level-order-traversal/ 中等:https://leetcode.com/problems/minesweeper/ 中等:https://leetcode.com/problems/minimum-height-trees/ 困难:https://leetcode.com/problems/bus-routes/

yxs354 commented 5 years ago

学号:044 Username:yxs354 第三周作业链接:https://github.com/yxs354/algorithm/tree/master/Week_03/id_44 学习感言: #483

speng975 commented 5 years ago

学号:102 Username:speng975 第三周作业链接:https://github.com/speng975/algorithm/tree/master/Week_03/id_102 学习感言: #485

shimmer236 commented 5 years ago

学号:62 Username:shimmer236 第三周作业链接:https://github.com/shimmer236/algorithm/tree/qq/Week_03/id_62 学习感言:487

sadcat commented 5 years ago

学号:113 Username:sadcat 第三周作业链接:https://github.com/algorithm001/algorithm/pull/488 学习感言:https://github.com/algorithm001/algorithm/issues/489

isnotnull commented 5 years ago
  1. 学号:074 Username:isnotnull
  2. 第三周作业链接:https://github.com/isnotnull/algorithm/tree/master/Week_03/id_74
  3. 学习感言: #491
361028096 commented 5 years ago

学号:053 Username: 361028096 第三周作业链接:https://github.com/361028096/algorithm/tree/master/Week_03/id_53 学习感言:#492

HongChao6 commented 5 years ago
  1. 学号:131 Username:HongChao6
  2. 第三周作业链接:https://github.com/HongChao6/algorithm/tree/master/Week_03/id_131
  3. 学习感言: #494
HongChao6 commented 5 years ago

学号:053 Username: 361028096 第三周作业链接:https://github.com/361028096/algorithm/tree/master/Week_03/id_53 学习感言:#492

LeetCode_703_053函数 与 add 函数有相同的代码,可以考虑 在LeetCode_703_053函数中,直接调用add函数

HongChao6 commented 5 years ago
1. 学号:074 Username:isnotnull

2. 第三周作业链接:https://github.com/isnotnull/algorithm/tree/master/Week_03/id_74

3. 学习感言: #491

这两道题,正好没做,学习了,看你的 “373. 查找和最小的K对数字” 真是简单暴力

HongChao6 commented 5 years ago

学号:113 Username:sadcat 第三周作业链接:#488 学习感言:#489

你这提交的不对啊,你的作业链接不能提交LeetCode的链接,我们点进去后,查看的是我们自己的东西,不是你的!

HongChao6 commented 5 years ago

学号:62 Username:shimmer236 第三周作业链接:https://github.com/shimmer236/algorithm/tree/qq/Week_03/id_62 学习感言:487

递归这个东西,练得的多了,后边自然而然的就写出来的 703题中 KthLargest函数 与 add 函数有相同的代码,可以考虑 在KthLargest函数中,直接调用add函数

HongChao6 commented 5 years ago

学号:102 Username:speng975 第三周作业链接:https://github.com/speng975/algorithm/tree/master/Week_03/id_102 学习感言: #485

你 104题,一句话就搞定了 return max(maxDepth(root->left), maxDepth(root->right)) + 1; 不过我还是喜欢,拆开写,这样可读性好一点

otkinlife commented 5 years ago

学号:061 Username: otkinlife(贾凯超) 第三周作业链接:https://github.com/otkinlife/algorithm/tree/master/Week_03/id_61 学习感言:#496

otkinlife commented 5 years ago

学号:044 Username:yxs354 第三周作业链接:https://github.com/yxs354/algorithm/tree/master/Week_03/id_44 学习感言: #483

思维训练原本在工作中也是我从来不重视的。以前都是以解决问题为目的,现在是要以优雅的解决问题为主。对于一个问题以后都要有意识的思考数据结构,算法,优化等方面的东西。

otkinlife commented 5 years ago

学号:102 Username:speng975 第三周作业链接:https://github.com/speng975/algorithm/tree/master/Week_03/id_102 学习感言: #485

997 我是用了两个一维数组分别表示入度和出度,感觉比较好理解一些

Maybrittnelson commented 5 years ago

学号:116 Username:Maybrittnelson 第三周作业链接:https://github.com/Maybrittnelson/algorithm/tree/master/Week_03/id_116 学习感言:#500

yulongz commented 5 years ago

学号:67 Username:yulongz 第三周作业链接:https://github.com/yulongz/algorithm/tree/master/Week_03/id_67 学习感言: #499

tidelgl commented 5 years ago

学号:64 Username:李路 第三周作业链接:https://github.com/tidelgl/algorithm/tree/week-3/Week_03/id_64 学习感言: https://github.com/algorithm001/algorithm/issues/503

bitwei commented 5 years ago

学号:99 Username:bitwei 第三周作业链接:https://github.com/bitwei/algorithm/tree/master/Week_03/id_99 学习感言: #506

FollowMyHeart commented 5 years ago
  1. 学号:033 Username:FollowMyHeart
  2. 第三周作业链接:https://github.com/FollowMyHeart/algorithm/tree/master/Week_03/id_33
  3. 学习感言:#507
yanlingli3799 commented 5 years ago

学号:118(李颜翎) 第三周作业链接:https://github.com/yanlingli3799/algorithm/tree/master/Week_03/id_118 学习感言: https://github.com/algorithm001/algorithm/issues/508 题目:207、210、924、928、997(Java)

gebitang commented 5 years ago

学号:087 Username:gebitang 第三周作业链接:https://github.com/gebitang/algorithm/tree/master/Week_03/id_87 学习感言: ##514 语言:java

SeanMrLi commented 5 years ago

学号:108 Username:SeanMrLi 第三周作业链接:https://github.com/SeanMrLi/algorithm/tree/master/Week_03/id_108 学习感言:https://github.com/algorithm001/algorithm/issues/515

zhangtianwang commented 5 years ago

学号:120 Username:zhangtianwang 第三周作业链接:https://github.com/zhangtianwang/algorithm/tree/master/Week_03/id_120 学习感言:#516

jonjia commented 5 years ago

学号:130 Username:jonjia 第三周作业链接:https://github.com/jonjia/algorithm/tree/master/Week_03/id_130 学习感言: #517 实现语言:JavaScript

kk5171 commented 5 years ago

学号:119 Username:kk5171 第三周作业链接:https://github.com/kk5171/algorithm/tree/master/Week_03/id_119 学习感言: #519

FollowMyHeart commented 5 years ago

学号:102 Username:speng975 第三周作业链接:https://github.com/speng975/algorithm/tree/master/Week_03/id_102 学习感言: #485

判断是法官的条件只是一个就可以了吗?

Lugyedo commented 5 years ago

学号:036 GitHub UserName:Lugyedo 第三周作业链接:https://github.com/Lugyedo/algorithm/tree/master/Week_03/id_36 学习感言:https://github.com/algorithm001/algorithm/issues/521

lglove commented 5 years ago

学号:024 GitHub UserName:lglove 第三周作业链接:https://github.com/lglove/algorithm/tree/master/Week_03/id_24 学习感言:#525

yanlingli3799 commented 5 years ago

学号:028 Username:myrichhub 第三周作业链接:https://github.com/myrichhub/algorithm/tree/master/Week_03/id_28 学习感言: #479

997写的好简洁,学习了

yanlingli3799 commented 5 years ago
  1. 学号:131 Username:HongChao6
  2. 第三周作业链接:https://github.com/HongChao6/algorithm/tree/master/Week_03/id_131
  3. 学习感言: #494

997总结部分写错了,入度应为N-1,因为要去掉法官自己。(代码写对了,哈哈哈哈)

yanlingli3799 commented 5 years ago

学号:120 Username:zhangtianwang 第三周作业链接:https://github.com/zhangtianwang/algorithm/tree/master/Week_03/id_120 学习感言:#516

210代码好像写复杂了,可以再进一步优化一下。

bugcodes commented 5 years ago

学号:49 Username:bugcodes 第三周作业链接:https://github.com/bugcodes/algorithm/tree/master/Week_03/id_49 学习感言: #527

yanlingli3799 commented 5 years ago

学号:67 Username:yulongz 第三周作业链接:https://github.com/yulongz/algorithm/tree/master/Week_03/id_67 学习感言: #499

递归分解总结的很赞!

yanlingli3799 commented 5 years ago

学号:108 Username:SeanMrLi 第三周作业链接:https://github.com/SeanMrLi/algorithm/tree/master/Week_03/id_108 学习感言:#515

997整体解题思路都写了下来,还做了时间复杂度分析,赞。

salanhess commented 5 years ago

学号:040 Username:salanhess 第三周作业链接:https://github.com/salanhess/algorithm/tree/master/Week_03/id_40 学习感言: https://github.com/algorithm001/algorithm/issues/530

luckypeak commented 5 years ago

学号:124 Username:luckypeak 第三周作业链接:https://github.com/luckypeak/algorithm/tree/master/Week_03/id_124 学习感言: https://github.com/algorithm001/algorithm/issues/532

Hermancg commented 5 years ago

学号:088 Username:Hermancg 第三周作业链接:https://github.com/Hermancg/algorithm/tree/master/Week_03/id_88 学习感言: #534

wangxu0 commented 5 years ago

学号:134 Username:wxisme 第三周作业链接:https://github.com/wxisme/algorithm/tree/master/Week_03/id_134 学习感言:https://github.com/algorithm001/algorithm/issues/535

jianghaoyuan2007 commented 5 years ago

学号:038 Username:jianghaoyuan2007 第三周作业链接:https://github.com/jianghaoyuan2007/algorithm/tree/master/Week_03/id_38 学习感言: #531

Water-DD commented 5 years ago

学号:011 Username:Water-DD 第三周作业链接:https://github.com/Water-DD/algorithm/tree/master/Week_03/id_11 学习感言: #536

aiter commented 5 years ago

学号:014 Username:aiter 第三周作业链接:https://github.com/aiter/algorithm/tree/master/Week_03/id_14 学习感言:#537

zouyingjie commented 5 years ago

学号:001 Username: zouyingjie 第三周作业链接:https://github.com/zouyingjie/algorithm/tree/master/Week_03/id_1 学习感言:#538

SherryShi0108 commented 5 years ago

学号:086 Username: SherryShi0108 第三周作业链接:https://github.com/SherryShi0108/algorithm/tree/master/Week_03/id_86 学习感言:#539

suncen0505 commented 5 years ago

学号:126 Username: suncen0505 第三周作业链接:https://github.com/suncen0505/algorithm/tree/master/Week_03/id_126 学习感言:#542

hapiman commented 5 years ago

学号:117 Username:hapiman(彭建) 第三周作业链接:https://github.com/hapiman/algorithm/tree/master/Week_03/id_117 学习感言:https://github.com/algorithm001/algorithm/issues/541 编程语言:Golang

hapiman commented 5 years ago

学号:014 Username:aiter 第三周作业链接:https://github.com/aiter/algorithm/tree/master/Week_03/id_14 学习感言:#537

997题目分析文档不错,值得学习