← 返回资讯屏轩教育 · 行业资讯

IGCSE CIE Mathematics: Algorithms Revision Guide | IGCSE CIE 数学:算法 考点精讲

2026-07-14 18:30 · 本文部分内容由AI辅助创作

📚 IGCSE CIE Mathematics: Algorithms Revision Guide | IGCSE CIE 数学:算法 考点精讲

Algorithms lie at the heart of problem-solving in mathematics. In the IGCSE CIE syllabus, you are expected to design, interpret and refine step-by-step procedures using flowcharts and pseudocode. This guide breaks down every essential concept, from basic symbols to sorting and searching, helping you master algorithmic thinking for your exams.

算法是数学问题解决的核心。在 IGCSE CIE 大纲中,你需要掌握使用流程图和伪代码来设计、解释和改进分步过程。本指南帮你逐一攻克每个重要概念,从基本符号到排序与搜索,帮助你在考试中掌握算法思维。

1. What is an Algorithm? | 什么是算法?

An algorithm is a finite sequence of well-defined, step-by-step instructions for solving a problem or completing a task. It must have clear inputs and outputs, and it must terminate after a limited number of steps.

算法是解决问题或完成任务的有限序列,由明确定义的、分步的指令组成。它必须有清晰的输入和输出,并且必须在有限的步骤后终止。

In everyday life, a recipe or a set of directions can be seen as an algorithm. In mathematics, algorithms are used for calculations such as finding the highest common factor or sorting a list of numbers.

在日常生活中,一份食谱或一组导航指引都可以看作算法。在数学里,算法用于计算,例如寻找最大公因数或对一列数字排序。

For your IGCSE exam, you need to express algorithms in two forms: flowcharts and pseudocode. You also need to trace given algorithms to find their outputs or identify errors.

在 IGCSE 考试中,你需要用两种形式表达算法:流程图和伪代码。你还需要追踪给定的算法,找出输出或识别错误。


2. Flowchart Symbols | 流程图符号

Flowcharts use standard symbols to represent different types of steps. Recognising and drawing these correctly is a key exam skill.

流程图用标准符号表示不同类型的步骤。正确识别和绘制这些符号是关键的考试技能。

SymbolNamePurpose中文解释
Stadium shape (oval)Start / EndIndicates the beginning or end of the algorithm.表示算法的开始或结束。
ArrowFlow lineShows the direction of logic flow.显示逻辑流向。
RectangleProcessRepresents an operation or calculation (e.g., x ← x + 1).表示操作或计算(如 x ← x + 1)。
DiamondDecisionA condition that determines the next path (e.g., Is x > 10?). Yes/No branches.一个条件,决定下一步路径(如 x > 10 ?),有“是”“否”分支。
ParallelogramInput / OutputShows data entering or leaving the system.显示数据输入或输出。

Always connect symbols with arrows. Decision diamonds have two outgoing arrows labelled 'Yes' and 'No'. Avoid crossing lines unnecessarily.

始终用箭头连接符号。决策菱形有两个向外箭头,标记为“是”和“否”。避免不必要的线交叉。


3. Pseudocode Basics | 伪代码基础

Pseudocode is a simplified, language-independent way to express algorithms using common English words and mathematical notation. It is not a programming language, but it follows some consistent rules.

伪代码是一种简化的、不依赖具体编程语言的算法表达方式,使用常见的英文词汇和数学符号。它不是编程语言,但遵循一些一致的规则。

Key conventions you must use in CIE pseudocode:

在 CIE 伪代码中必须使用的关键约定:

Always indent lines inside structures for clarity. CIE examiners expect correct indentation and the proper use of keywords.

为了清晰,在结构内的行始终缩进。CIE 考官期望正确的缩进和关键字使用。


4. Variables, Assignment and Input/Output | 变量、赋值与输入/输出

A variable is a named storage location that holds a value, which can change during the algorithm's execution. Assignment gives a variable a value.

变量是一个命名的存储位置,保存一个值,该值在算法执行过程中可以改变。赋值就是给变量一个值。

Example: count ← 0 sets count to 0. The left arrow means 'becomes'. Do not write count = 0 because the equals sign is reserved for comparison.

例子:count ← 0 将 count 设为 0。左箭头表示“变为”。不要写 count = 0,因为等号保留用于比较。

INPUT reads a value from the user or data source. OUTPUT displays a value. Often you combine them.

INPUT 从用户或数据源读取一个值。OUTPUT 显示一个值。经常会将它们组合使用。

INPUT firstNumber
INPUT secondNumber
sum ← firstNumber + secondNumber
OUTPUT sum

输入第一个数
输入第二个数
和 ← 第一个数 + 第二个数
输出 和

Always initialise variables before using them in calculations; otherwise, unpredictable values may be assumed.

在计算中使用变量之前,始终要对变量进行初始化;否则可能会用到不可预测的值。


5. Conditional Statements (IF…THEN…ELSE) | 条件语句(IF…THEN…ELSE)

Conditional statements allow the algorithm to make decisions. The structure is:

条件语句让算法能够做出决策。结构如下:

IF condition THEN
 statement(s)
ELSE
 alternative statement(s)
ENDIF

如果 条件 则
 语句
否则
 替代语句
结束条件

The ELSE part is optional. You can also nest IF statements or use multiple conditions with AND, OR.

ELSE 部分是可选的。你也可以嵌套 IF 语句,或者用 AND、OR 组合多个条件。

Example: IF mark > 50 THEN OUTPUT 'Pass' ELSE OUTPUT 'Fail' ENDIF. Conditions often use comparison operators: =, ≠, <, >, ≤, ≥.

例子:IF mark > 50 THEN OUTPUT 'Pass' ELSE OUTPUT 'Fail' ENDIF。条件经常使用比较运算符:=、≠、<、>、≤、≥。

In flowcharts, this is drawn as a diamond with two outgoing arrows. The 'Yes' branch follows the true case; the 'No' branch follows the false case.

在流程图中,这画成一个菱形,带有两个外出箭头。“是”分支遵循真情况;“否”分支遵循假情况。


广告 / Sponsored

6. Loops: FOR, WHILE, REPEAT | 循环:FOR、WHILE、REPEAT

Loops repeat a block of statements. CIE expects you to handle three types.

循环会重复执行一个语句块。CIE 要求你掌握三种类型。

FOR loop (count-controlled)

FOR i ← 1 TO 10
 OUTPUT i
NEXT i

对于 i 从 1 到 10
 输出 i
下一 i

You know exactly how many times the loop runs. The loop variable i automatically increments by 1 each time, unless a STEP is specified.

你可以确切知道循环运行多少次。除非指定了 STEP,否则循环变量 i 每次自动增加 1。

WHILE loop (pre-condition)

WHILE count < 5 DO
 OUTPUT count
 count ← count + 1
ENDWHILE

当 count < 5 时执行
 输出 count
 count ← count + 1
结束循环

The condition is checked before each iteration. If it is false from the start, the loop body never executes.

每次循环前检查条件。如果一开始就为假,则循环体永远不会执行。

REPEAT…UNTIL loop (post-condition)

REPEAT
 INPUT num
UNTIL num > 0

重复
 输入 num
直到 num > 0

The block runs at least once because the condition is tested at the end. This is useful for input validation.

循环体至少执行一次,因为条件在末尾测试。这对输入验证很有用。


7. Linear Search Algorithm | 线性搜索算法

Linear search is a basic algorithm that finds whether an item exists in a list by checking each element in order. It is straightforward but can be slow for large lists.

线性搜索是一种基本算法,通过按顺序检查每个元素来确定列表中是否存在某个项目。它简单直接,但对于大列表可能较慢。

Pseudocode for linear search in a list A of length n, searching for a target value target:

对于长度为 n 的列表 A,搜索目标值 target 的线性搜索伪代码:

i ← 0
found ← FALSE
WHILE i < n AND found = FALSE DO
 IF A[i] = target THEN
  found ← TRUE
 ELSE
  i ← i + 1
 ENDIF
ENDWHILE
IF found = TRUE THEN
 OUTPUT 'Found at index ', i
ELSE
 OUTPUT 'Not found'
ENDIF

i ← 0;found ← FALSE;当 i < n 且 found = FALSE 时执行/如果 A[i] = target 则 found ← TRUE 否则 i ← i+1/结束条件/结束循环如果 found = TRUE 则输出 'Found at index', i 否则输出 'Not found'

Trace tables are often used in exams to track variable changes in each iteration. Always initialise the flag variable found correctly.

考试中常用追踪表记录每次迭代中变量的变化。务必正确初始化标志变量 found。


8. Bubble Sort Algorithm | 冒泡排序算法

Bubble sort arranges items in ascending or descending order by repeatedly comparing adjacent pairs and swapping them if they are in the wrong order. It is one of the most frequently tested sorting algorithms in CIE IGCSE.

冒泡排序通过反复比较相邻对并在顺序错误时交换它们,将项目按升序或降序排列。这是 CIE IGCSE 中最常考的排序算法之一。

Pseudocode for ascending bubble sort on array A of size n:

对于大小为 n 的数组 A 进行升序冒泡排序的伪代码:

FOR i ← 0 TO n-2
 FOR j ← 0 TO n-i-2
  IF A[j] > A[j+1] THEN
   temp ← A[j]
   A[j] ← A[j+1]
   A[j+1] ← temp
  ENDIF
 NEXT j
NEXT i

对于 i 从 0 到 n-2/对于 j 从 0 到 n-i-2/如果 A[j] > A[j+1] 则交换它们/下一 j/下一 i

After each outer loop pass, the largest unsorted element 'bubbles' to its correct position at the end. The inner loop range decreases by one each time because the final elements are already in place.

每完成一次外循环,最大的未排序元素就会“冒泡”到正确的最末尾位置。内循环范围每次减一,因为末尾元素已经就位。

In an exam, you may be asked to perform a dry run or complete a trace table after each pass. Always use a temporary variable (temp) for swapping.

在考试中,你可能需要执行干运行或在每趟交换后填写追踪表。始终使用临时变量(temp)进行交换。


9. Finding Maximum and Minimum | 查找最大值和最小值

Finding the largest or smallest number in a list is a fundamental algorithmic task. It is often combined with loops and conditions.

在列表中寻找最大或最小数字是一项基本的算法任务。它通常与循环和条件结合。

To find the maximum value in array A with n elements:

查找具有 n 个元素的数组 A 中的最大值:

max ← A[0]
FOR i ← 1 TO n-1
 IF A[i] > max THEN
  max ← A[i]
 ENDIF
NEXT i
OUTPUT max

max ← A[0];对于 i 从 1 到 n-1/如果 A[i] > max 则 max ← A[i]/下一 i/输出 max

For the minimum, initialise with min ← A[0] and compare with <. Always initialise with the first element, never with zero, as the list may contain negative numbers.

对于最小值,用 min ← A[0] 初始化并与 < 比较。始终用第一个元素初始化,不要用零,因为列表中可能含有负数。


10. Algorithm Efficiency and Trace Tables | 算法效率与追踪表

Efficiency considers how many steps an algorithm takes as the input size grows. In IGCSE, you are not expected to perform formal complexity analysis, but you should recognise that some algorithms are faster than others.

效率考虑随着输入规模增长,算法需要多少步。在 IGCSE 中,不要求做正式的复杂度分析,但你应该认识到有些算法更快。

Linear search on a list of size n takes at most n comparisons. Bubble sort takes roughly n²/2 comparisons in the worst case. Binary search (only for sorted lists) is much faster but is not always required in core IGCSE – check your syllabus.

对大小为 n 的列表进行线性搜索,最多需要 n 次比较。冒泡排序在最坏情况下大约需要 n²/2 次比较。二分搜索(仅适用于已排序列表)要快得多,但在核心 IGCSE 中不一定要求——请核对大纲。

A trace table is a systematic way of recording the values of variables after each step. It is a crucial exam skill for testing and debugging algorithms.

追踪表是记录每一步后变量值的一种系统方法。这是测试和调试算法的关键考试技能。

To construct a trace table:

构建追踪表的步骤:

Practising trace tables with bubble sort or search algorithms will significantly improve your confidence.

用冒泡排序或搜索算法练习追踪表将显著增强你的信心。


11. Common Pitfalls and Exam Tips | 常见错误与考试技巧

Many students lose marks not because they do not understand algorithms, but because of small slip-ups. Pay attention to these points:

许多学生不是因为不懂算法而失分,而是因为小失误。请注意以下几点:

Additionally, always cross-check your loop termination conditions. An off-by-one error can invalidate the whole logic.

此外,反复检查循环终止条件。一次“差一”错误会使整个逻辑无效。


Published by TutorHao | Mathematics Revision Series | aleveler.com

广告 / Sponsored
【现货】剑桥国际高中教材 Cambridge IGCSE & O Level Additional Mathemati…
数学 备考教辅 · 正版现货 · 与本文内容相关
查看详情 / View on Taobao参考价 ¥198.0

更多咨询请联系16621398022(同微信)

备考资讯每日更新,关注不错过
考纲变化 · 科目分析 · 学习方法
扫码关注公众号 tutorhao
在微信里长按二维码识别关注
或截图后用「扫一扫 → 相册」选择本图
公众号:tutorhao