吃一只汤包的“算法” 顺序很重要: ·将包子从蒸笼中轻轻提起,and then ·将包子慢慢移动到面前的碟子中,and then ·在包子的上方咬开一个小口,and then ·通过小口吸食包子里的汤,and then ·将包子送入口中 完成!
吃一只汤包的“算法” •顺序很重要: •将包子从蒸笼中轻轻提起,and then •将包子慢慢移动到面前的碟子中,and then •在包子的上方咬开一个小口,and then •通过小口吸食包子里的汤,and then •将包子送入口中 完成!
如何理解下面这句话? My second remark is that our intellectual powers are rather geared to master static relations and that our powers to visualize processes evolving in time are relatively poorly developed.For that reason we should do our utmost to shorten the conceptual gap between the static program_and the dynamic process,to make the correspondence between the program (spread out in text space)and the process (spread out in time)as trivial as possible. https://enwikipedia.org/wiki/Edsger_WDijkstra ----E.W.Dijkstra
如何理解下面这句话? • My second remark is that our intellectual powers are rather geared to master static relations and that our powers to visualize processes evolving in time are relatively poorly developed. For that reason we should do our utmost to shorten the conceptual gap between the static program and the dynamic process, to make the correspondence between the program (spread out in text space) and the process (spread out in time) as trivial as possible. ----E.W.Dijkstra https://en.wikipedia.org/wiki/Edsger_W._Dijkstra
策略一:控制数量 注意: 这个过程的“结构”与计 假如规定吃X只 开始 数器的初始值没有关系」 Bound iteration 设一个计数器,并 将其值设定为0。 吃一只汤包 计数器值加1,并 否 判断其是否为X 是 结束
Bound iteration 假如规定吃X只 X
策略二:吃饱为止 开始 Unbound iteration 是 是否已饱? 结束 吃一只汤包 如果即使饱了,也希望再品尝一个,该怎么办? 问题:你能正确选择采用何种策略设计循环吗?
如果即使饱了,也希望再品尝一个,该怎么办? Unbound iteration 问题:你能正确选择采用何种策略设计循环吗?