The second question I want to ask is what's the base case? When do I get down to a problem that's small enough that it's basically trivial to solve? Here it was lists of size one. I could have stopped at lists of size two right. That's an easy comparison.
第二个问题是什么是基础条件?,我要将问题分解到何时才使得问题,小到可以解决的基本问题?,这里是当列表的长度为1有时候,我也可以在长度为2的时候停止分解,那是一个非常简单的对比。
If you were asking questions, like, how high does it go, but you don't ask when does it go to the highest point, then you don't have to go through the whole process of finding the time at which it turned around.
如果你想问,例如,它可以到多高,不过你并没有问它何时达到最高点,那么你不用从头到尾再来一遍,来弄清质点何时转向
应用推荐