-
Notifications
You must be signed in to change notification settings - Fork 41
算法训练营(深圳站)第一周作业 #1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
#作业提交 |
(通过Quote reply,在这里写下你对某位同学代码作业或学习总结的点评) |
#作业提交 |
#作业提交 |
对于对称2叉树(leetCode 101) 另外对于如果当前节点值不相同直接返回false即可,否则,直接双层下探; |
1、 LeetCode_104_37,else这个代码可以去除,因为如果root == null就已经返回了。减少代码量 |
#作业提交 |
作业提交学号:040 |
#作业提交 |
二叉搜索树缺少第三个条件, 它的左、右子树也分别为二叉搜索树 |
针对Week_01/id_35/LeetCode_49_035.java中代码
可优化为
|
#作业提交 |
#作业提交 |
#作业提交 |
#作业提交 |
学号:05 |
#作业提交 |
#作业提交 |
#作业提交 |
24 题的 Swap Nodes in Paris 的常规解法需要四个指针,绕来绕去,有点晕,不过可以考虑递归解法。还在研究中 |
Merge-Two-Sorted-Lists递归的解法不错呀,学习下新的思路,我都是用简历指针,各种穿针引线用的,有时候比较头晕 |
js 代码好简洁,正在研究中。。。。 |
sum of two 的解法,两个循环的 map 和一个循环的 map 还是有时间差别哦。效率还是差距很大,不过在理解方面还是相反的。HashMap 的解题思路在很多方面都有借鉴了。 |
merge sorted array 那道题,拷贝数组和排序都需要耗费时间,我这里的思路好像指针挪动可以弄。目前还没想到具体解法。 |
1、LeetCode_1_32,第18行中的 index != i 这个条件是不需要的,因为i是递增的map中的value与i肯定是不一致的,并且,只要target - num[i]作为map的key获取值存在,就说明当前这个值肯定和map那个值两个相加是等于target了。 |
1、Solution101,第40行中的else其实不用的,因为如果if满足就已经return了; |
LeetCode.104.maximum-depth-of-binary-tree.java中17、18行可以直接合成一行,因为新的变量都没地方用了, |
js写法挺好的,也够简洁,学习了! |
没错,是这个理 |
总结写的很励志,加油 |
脑图画的相当厉害,已保存到本地 |
|
很精简呢! |
很精简呢! |
很用心的每题写了多种解法, 赞! |
LeetCode_783_23, LeetCode_104_23,LeetCode_111_23这三题, 你的解法是可行的, 但应该有更短解法 :) |
这个算法的弄通的过程是这样的,对于程序猿来讲,太多的时候,逻辑以及算法的步骤大都很难一步到位,都是在debug的过程。但是debug的次数多了,这些逻辑会得到总结,成为了内功,后面处理这种问题的速度就会越来越快了。共勉! |
对于递归的总结,完全赞同,重要的是如何习惯和适应以及总结这种总结,总结出重复简单的重复子问题。 |
我突然发现你的脑图比我的好看,这算不算点评,哈哈哈! |
可以考虑采用guard,如果if return,就不需要else |
isSymmetric 里递归method的名字可以考虑改一下,实际并不是判断isSame而是对称,可以还叫isSymmetric或者isMirror, 最后一行太长了,可以考虑每个条件一行 |
可以考虑用ArrayDeque做stack |
49题代码略冗余
考虑用以下代码
|
#作业提交 总结:#51 |
26题的写法简介明了, 有指导意义 |
脑图画的相当厉害 |
刷题不少,分析的很到位,get |
代码很干净,题目做的不少啊,这个学习笔记很全面,总结的的很好 |
学习了js写法,这个数据结构图很全面啊,包括优缺点都有,先mark下来了 |
学习下swift写法 |
体量很大啊,学习下Go写法 |
#作业提交 |
注释详尽,代码写得很好哦 |
做了好多题目啊哈哈,了解一下go |
做了很多题目哦,学习一下python写法 |
做了好多题目啊,和我一样努力哈哈 |
Uh oh!
There was an error while loading. Please reload this page.
要求
注意事项
第一周题目
数组、链表
简单:https://leetcode-cn.com/problems/remove-duplicates-from-sorted-array/
简单:https://leetcode-cn.com/problems/rotate-array/
简单:https://leetcode-cn.com/problems/merge-two-sorted-lists/
简单:https://leetcode-cn.com/problems/merge-sorted-array/
中等:https://leetcode-cn.com/problems/swap-nodes-in-pairs/
中等:https://leetcode-cn.com/problems/3sum/
Map & Set
简单:https://leetcode-cn.com/problems/valid-anagram/
中等:https://leetcode-cn.com/problems/group-anagrams/
堆栈、队列
简单:https://leetcode-cn.com/problems/remove-all-adjacent-duplicates-in-string/
简单:https://leetcode-cn.com/problems/remove-outermost-parentheses/
困难:https://leetcode.com/problems/largest-rectangle-in-histogram/
困难:https://leetcode.com/problems/trapping-rain-water/
二分查找
简单:https://leetcode-cn.com/problems/arranging-coins/
中等:https://leetcode-cn.com/problems/powx-n/
困难:https://leetcode-cn.com/problems/dungeon-game/
递归
简单:https://leetcode-cn.com/problems/maximum-depth-of-binary-tree/
简单:https://leetcode-cn.com/problems/symmetric-tree/
简单:https://leetcode-cn.com/problems/minimum-depth-of-binary-tree/
简单:https://leetcode-cn.com/problems/minimum-distance-between-bst-nodes/
简单:https://leetcode-cn.com/problems/binary-tree-paths/
简单:https://leetcode-cn.com/problems/range-sum-of-bst/
中等:https://leetcode-cn.com/problems/lowest-common-ancestor-of-a-binary-tree/
作业提交规则
https://github.com/algorithm002/algorithm/blob/master/README.md
The text was updated successfully, but these errors were encountered: