Developing Algorithms
Introduced| English | Meaning |
|---|---|
| algorithm/ˈælɡərɪθəm/ | A finite sequence of precise steps for solving a problem or carrying out a task. |
| finite/ˈfaɪnaɪt/ | Having a limited size, number or extent. |
| sequencing/ˈsiːkwənsɪŋ/ | Doing steps one after another. |
| flowchart/ˈfləʊtʃɑːt/ | A diagram showing the sequence of steps and decisions in a process or algorithm. |
| natural language/ˈnætʃərəl ˈlæŋɡwɪdʒ/ | natural language |
| same result/seɪm rɪˈzʌlt/ | same result |
| refine/rɪˈfaɪn/ | refine |
| efficient/ɪˈfɪʃənt/ | Using resources without avoidable waste, or allocating them to maximise the relevant net benefit. |
What is an algorithm?
- An algorithm 算法 is a finite 有限的, step-by-step set of instructions to complete a task.
- "Finite" means it always ends after a limited number of steps.
- A recipe, a route to school, and a sorting method are all algorithms.
- Every program is built from algorithms.
An algorithm is:
Difficulty 1/5 · 100 coins + a small bonus on first completion today
"Finite" means it always ends after a limited number of steps.
Three building blocks
- Every algorithm can be built from three basic structures:
- sequencing 顺序: doing steps one after another;
- selection: choosing between paths;
- iteration: repeating steps.

A flowchart 流程图 lays out an algorithm using the standard symbols
Sequencing, selection, or iteration?
Every algorithm is built from three structures: sequencing (steps in order), selection (choosing a path), and iteration (repeating steps).
Which are the three building blocks of algorithms? (Select all that apply)
Difficulty 2/5 · 140 coins + a small bonus on first completion today
Sequencing, selection, and iteration build every algorithm.
A flowchart, pseudocode, and natural language can all express:
Difficulty 1/5 · 100 coins + a small bonus on first completion today
All three describe the same steps differently.
Two different algorithms can never produce the same correct result.
Difficulty 1/5 · 100 coins + a small bonus on first completion today
False. Different algorithms can solve the same problem correctly; one may simply be faster than the other.
Ways to express it
- You can express an algorithm as pseudocode, as a flowchart (boxes and arrows), or in plain natural language 自然语言.
- All three describe the same steps in different forms.
- Different algorithms can give the same result 相同结果 — one short but slow, another longer but fast.
- Neither is "more correct" if both give the right answer.
The "largest of three" algorithm runs on a=4, b=9, c=6. What does it output?
Difficulty 2/5 · 140 coins + a small bonus on first completion today
Start 4; 9 > 4 → 9; 6 > 9 is false → stays 9.
Improving an algorithm step by step to be correct, clear, and efficient is called ______.
Difficulty 1/5 · 100 coins + a small bonus on first completion today
Refining follows testing, making the algorithm better each pass.
Refine for efficiency
- We refine 改进 an algorithm so it is correct, clear, and efficient 高效.
- Refining means improving it step by step after testing.
Largest of three. largest ← a; IF b > largest: largest ← b; IF c > largest: largest ← c; DISPLAY largest. For a=4, b=9, c=6: start 4; 9 > 4 → largest 9; 6 > 9 is false → stays 9. Output 9. This uses sequencing and selection.
An algorithm is a finite set of steps, built from three structures: sequencing, selection, and iteration. You can express it as pseudocode, a flowchart, or natural language. Different algorithms can give the same result, so we refine them to be correct, clear, and efficient.