2023-08-30
1
zpxshl 2023-05-14 21:58:53 +08:00 via Android
羡慕。工作后一题都不想刷,完全不想动脑。。。
|
2
EHemingway 2023-05-14 22:34:57 +08:00
好狠
|
3
dif 2023-05-15 09:21:56 +08:00
羡慕,我才刷了两周就坚持不下去了。
|
5
x43125 2023-05-15 10:43:15 +08:00
同不想刷,刷两题就忘了,刷的时候也是,静不下来想,稍微想不到就想看题解
|
6
waytodelay 2023-05-15 10:47:08 +08:00
好佩服,坚持下去的动力是什么?
最近要找工作所以也有开始刷一些,如果只是比较简单的涉及数据结构的题,就感觉还好 那些要动用到数学思维的,就很头疼,主要自己数学也很差 |
7
JasonLaw OP @x43125 #5 如果是刚开始的话,建议跟着 Blind 75 做,理解每一种类型题目的解法,千万不要记答案。
|
8
JasonLaw OP @waytodelay #6 学习 Python 算是一个理由,最重要的是,让自己时刻保持 problem solving 的能力,还可以学到别人解决问题的想法,而且我也很享受解题过程。
我也不怎么做 hard 。BTW ,LeetCode 跟数学没有太大关系。 |
10
waytodelay 2023-05-15 14:45:49 +08:00
@JasonLaw 像动态规划那些,不是要自己也得有个推导的数学公式,这种跟数学还没关系吗
|
11
JasonLaw OP @waytodelay #10 没关系,一般人都会将动态规划错误地同等于 bottom-up ,但是动态规划包含了 bottom-up 和 top-down ,而 top-down 相对来说更加容易实现,当你完成了 top-down 之后,你就会很容易得出 bottom-up 版本。
From Poe - Sage: Dynamic programming can be implemented using a bottom-up approach or a top-down approach. In the bottom-up approach, also known as the "tabulation" method, the solution to a problem is computed iteratively starting from the smallest subproblem and building up to the larger problem. This approach is typically implemented using a table or array to store intermediate results. The advantage of the bottom-up approach is that it often has better space complexity than the top-down approach, since it avoids the overhead of recursion. In the top-down approach, also known as the "memoization" method, the solution to a problem is computed recursively, but with the added step of caching intermediate results so that they can be reused later. This approach can be more intuitive and easier to implement than the bottom-up approach, but it can suffer from the overhead of recursion and may not be as efficient in terms of space complexity. Both approaches have their advantages and disadvantages depending on the problem at hand. |
12
JasonLaw OP @waytodelay #10
以 Fibonacci sequence 为例,在 top-down 版本中,我们知道 f(n) = f(n-1) + f(n-2),然后 f(1)和 f(2)为 base case 。那么在 bottom-up 版本中,我们就可以以 f(1)和 f(2)为起点,一点一点往上解决更大的问题。 |
13
cangcang 2023-05-16 09:31:23 +08:00
刷了 200 道就开始腻了。现在每天就刷个日常题,保持一下思维
|
14
waytodelay 2023-05-16 14:21:05 +08:00
@JasonLaw 那我还得细细研究下,感觉 f(n)是怎么一步步来的还是需要一些思考
|
15
JasonLaw OP @waytodelay #14 f(n) = f(n-1) + f(n-2),需要一些思考没错,但是这个跟数学没有太大关系。
|