And get into the habit of using it to help you define what is the flow of control.
然后是养成用伪代码,来帮助你定义控制流的习惯。
Right, so the things we want you to take away from this are, get into the habit of using pseudo code when you sit down to start a problem, write out what are the steps.
好,这儿我想大家明白的就是,养成解决问题时先写伪代码的好习惯,把步骤都写出来,我想要告诉你们的是一个好的程序员。
So I'll now start to get into that habit, even though it's a bit of distracting detail, it's just consistent with the expectations that the compiler really has.
所以我现在将开始养成那个习惯,虽然这是一个有点分散注意力的细节,它只是与编译器,拥有的期望是并存的。
And I would suggest palindrome as a great example of that. That's easy to think about recursively. It's much harder to think about iteratively. And you want to get into the habit of deciding which is the right one for you to use. And with that, we'll see you next time.
其它的问题可能用递归的方式,可以更好的解决,而直接思考可能很困难,这时你就得养成做出,正确选择的好习惯了,下周再见。
应用推荐