Skip to content

Commit 702860f

Browse files
committed
Update What are Algorithms.markdown
1 parent 5e63426 commit 702860f

File tree

1 file changed

+12
-10
lines changed

1 file changed

+12
-10
lines changed

What are Algorithms.markdown

+12-10
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,20 @@
1-
# What are algorithms and data structures?
1+
# 什么是算法和数据结构?
22

3-
An algorithm is a recipe for making the computer do something. If you know how to cook, you understand algorithms!
3+
一个算法就像一张教计算机“烹饪”的“食谱”。如果你了解做菜的过程,你就能理解算法的定义。
44

5-
Here's a [recipe for pancakes](http://allrecipes.com/recipe/21014/good-old-fashioned-pancakes/):
5+
下面有一张关于[制作薄饼的食谱](http://allrecipes.com/recipe/21014/good-old-fashioned-pancakes/)
66

7-
1. In a large bowl, sift together flour, baking powder, salt and sugar.
8-
2. Pour in the milk, egg, and melted butter.
9-
3. Mix until smooth.
10-
4. Heat a frying pan over medium heat.
11-
5. Scoop the batter into the pan, using approximately 1/4 cup for each pancake.
12-
6. Brown the pancake on both sides.
7+
1. 首先,将面粉、泡打粉、盐和白砂糖倒入一个大碗中。
8+
2. 加入牛奶、鸡蛋和融化了的奶油。
9+
3. 搅拌混合直至丝柔顺滑。
10+
4. 中火加热平底锅。
11+
5. 将搅拌好的面糊缓慢倒入锅中,每个薄饼大概用 1/4 CUP 的面糊即可。
12+
6. 薄饼两面都呈黄褐色即可出锅享用了。
1313

14-
The recipe consists of a series of steps that you perform one after the other. An algorithm is just like that, except that it contains instructions for a computer to perform, not for a cook.
14+
这张食谱由一系列的步骤组成,你只需一步接一步按照指令来就可以了。算法也是如此,只不过它的指令是交给计算机去执行的,而不是厨师。
1515

1616
The ingredients -- flour, milk, eggs, butter -- are the data that the algorithm works on. The data goes into the algorithm in one form (raw, separate ingredients) and comes out in another (delicious pancakes!).
1717

18+
19+
1820
So what are the data structures? They are the containers that hold the data while the algorithm works on it. In the pancake recipe, the data structures are the bag that holds the flour, the mixing bowl where you combine everything, the frying pan that browns the pancake, and finally the plate used to serve the finished pancake.

0 commit comments

Comments
 (0)