Standard algorithms · Algoritmos estándar
| English | Español |
|---|---|
| linear search/ˈlɪnɪə sɜːtʃ/ | búsqueda lineal |
| bubble sort/ˈbʌbl sɔːt/ | bubble sort |
| counting/ˈkaʊntɪŋ/ | contando |
| totalling/ˈtəʊtəlɪŋ/ | sumatoria |
The classic recipes
- A few standard algorithms appear again and again.
- You must know linear search 线性查找, bubble sort 冒泡排序, and the counting 计数/totalling 求和 patterns.
- Each is short, but worth recognising instantly.
Las recetas clásicas
- Algunos algoritmos estándar aparecen una y otra vez.
- Debes conocer la búsqueda lineal (linear search), el ordenamiento burbuja (bubble sort) y los patrones de conteo/acumulación (counting/totalling).
- Cada uno es breve, pero vale la pena reconocerlos al instante.
Linear search
- A linear search checks each item in turn, from the start, until it finds the value (or reaches the end).
- It works on any list — no sorting needed.
A flowchart for the sum algorithm, using the standard symbols (start/end, input/output, process, decision).
Búsqueda lineal
DECLARE Found : BOOLEAN
Found ← FALSE
FOR I ← 1 TO 10
IF List[I] = SearchValue
THEN
Found ← TRUE
ENDIF
NEXT I
OUTPUT Found
- Una búsqueda lineal revisa cada elemento por su orden, desde el inicio, hasta que encuentra el valor (o llega al final).
- Funciona con cualquier lista — no se requiere ordenamiento previo.

Un diagrama de flujo para el algoritmo de suma, usando los símbolos estándar (inicio/fin, entrada/salida, proceso, decisión).
Standard algorithms · Algoritmos estándar
compare adjacent, swap if needed · comparar adyacentes, intercambiar si es necesario
Step through a bubble sort — compare neighbours and swap until everything is in order. · Paso a paso de un ordenamiento burbuja — comparar vecinos e intercambiar hasta que todo esté en orden.
A linear search finds a value by: · Una búsqueda lineal encuentra un valor mediante:
Linear search examines items one by one until it finds the value or reaches the end. · La búsqueda lineal examina los elementos uno por uno hasta encontrar el valor o llegar al final.
Bubble sort
- A bubble sort compares each side-by-side pair and swaps them if they are out of order.
- It repeats this until no more swaps are needed — leaving the list sorted.
Bubble sort compares each side-by-side pair and swaps them if they are out of order, repeating until sorted.
Ordenamiento burbuja
FOR I ← 0 TO 8
IF List[I] > List[I + 1]
THEN
Temp ← List[I]
List[I] ← List[I + 1]
List[I + 1] ← Temp
ENDIF
NEXT I
- Un ordenamiento burbuja compara pares adyacentes y los intercambia si están desordenados.
- Repite esto hasta que ya no sean necesarios más intercambios, dejando la lista ordenada.

El ordenamiento burbuja compara cada par adyacente e intercambia si están desordenados, repitiendo hasta quedar ordenado.
A bubble sort puts a list in order by: · Un ordenamiento burbuja coloca una lista en orden mediante:
It swaps out-of-order neighbours and repeats passes until no swaps are needed. · Intercambia vecinos desordenados y repite pasadas hasta que no se necesiten más intercambios.
Totalling, counting, max/min/average
- Totalling — keep a running total:
Total ← Total + Value. - Counting — add 1 each time something happens:
Count ← Count + 1. - Maximum/minimum — keep the largest/smallest value seen so far.
- Average — divide the total by how many values there are.
Acumulación, conteo, máximo/mínimo/promedio
- Acumulación — mantener un total acumulado:
Total ← Total + Value. - Conteo — sumar 1 cada vez que ocurre algo:
Count ← Count + 1. - Máximo/mínimo — mantener el valor mayor/menor visto hasta ahora.
- Promedio — dividir el total entre la cantidad de valores.
Which line adds a value to a running total? · ¿Qué línea agrega un valor a un total acumulado?
total ← total + value accumulates a sum; count ← count + 1 counts occurrences. · total ← total + value acumula una suma; count ← count + 1 cuenta las ocurrencias.
Match each standard algorithm to how it works. · Relacione cada algoritmo estándar con su funcionamiento.
These four — search, sort, total and max — are the building blocks of most exam algorithms. · Estos cuatro — búsqueda, ordenación, suma y máximo — son los bloques fundamentales de la mayoría de los algoritmos de examen.
Using totalling on the list [2, 4, 6, 8], what is the final total? · Usando suma acumulada en la lista [2, 4, 6, 8], ¿cuál es el total final?
2 + 4 + 6 + 8 = 20.
You've got it
- linear search checks each item in turn (works on any list)
- bubble sort swaps out-of-order neighbours, repeating until sorted
- totalling (
Total ← Total + Value) and counting (Count ← Count + 1) - max/min = keep the best so far; average = total ÷ count
Ya lo dominas
- La búsqueda lineal revisa cada elemento por su orden (funciona con cualquier lista).
- El ordenamiento burbuja intercambia vecinos desordenados, repitiendo hasta quedar ordenado.
- La acumulación (
Total ← Total + Value) y el conteo (Count ← Count + 1). - máx/mín = mantener lo mejor visto hasta ahora; promedio = total ÷ contador.