Developing Algorithms · Desarrollo de Algoritmos
| English | Español |
|---|---|
| algorithm/ˈælɡərɪθəm/ | algoritmo |
| finite/ˈfaɪnaɪt/ | finito |
| sequencing/ˈsiːkwənsɪŋ/ | secuenciación |
| flowchart/ˈfləʊtʃɑːt/ | diagrama de flujo |
| natural language/ˈnætʃərəl ˈlæŋɡwɪdʒ/ | lenguaje natural |
| same result/seɪm rɪˈzʌlt/ | mismo resultado |
| refine/rɪˈfaɪn/ | refinar |
| efficient/ɪˈfɪʃənt/ | eficiente |
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.
¿Qué es un algoritmo?
- Un algoritmo 算法 es un conjunto finito 有限的, paso a paso de instrucciones para completar una tarea.
- "Finito" significa que siempre termina después de un número limitado de pasos.
- Una receta, una ruta hacia la escuela y un método de ordenamiento son todos algoritmos.
- Todo programa está construido a partir de algoritmos.
An algorithm is: · Un algoritmo es:
"Finite" means it always ends after a limited number of steps. · "Finito" significa que siempre termina después de un número limitado de pasos.
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.
Tres bloques de construcción
- Cada algoritmo puede construirse a partir de tres estructuras básicas:
- secuenciación 顺序: realizar los pasos uno tras otro;
- selección: elegir entre caminos;
- iteración: repetir pasos.
Sequencing, selection, or iteration? · ¿Secuenciación, selección o iteración?
Every algorithm is built from three structures: sequencing (steps in order), selection (choosing a path), and iteration (repeating steps). · Todo algoritmo se construye a partir de tres estructuras: secuenciación (pasos en orden), selección (elegir un camino) e iteración (repetir pasos).
Which are the three building blocks of algorithms? (Select all that apply) · ¿Cuáles son los tres bloques fundamentales de los algoritmos? (Seleccione todas las que correspondan)
Sequencing, selection, and iteration build every algorithm. · La secuenciación, la selección y la iteración constituyen todo algoritmo.
A flowchart, pseudocode, and natural language can all express: · Un diagrama de flujo, pseudocódigo y lenguaje natural pueden expresar todos ellos:
All three describe the same steps differently. · Los tres describen los mismos pasos de manera diferente.
Two different algorithms can produce the same correct result, one faster than the other. · Dos algoritmos diferentes pueden producir el mismo resultado correcto, siendo uno más rápido que el otro.
Neither is "more correct" if both give the right answer. · Ninguno es "más correcto" si ambos dan la respuesta adecuada.
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.
Formas de expresarlo
- Puedes expresar un algoritmo como pseudocódigo, como un diagrama de flujo 流程图 (cajas y flechas), o en lenguaje natural 自然语言 simple.
- Las tres describen los mismos pasos en diferentes formas.
- Diferentes algoritmos pueden dar el mismo resultado 相同结果 —uno corto pero lento, otro más largo pero rápido.
- Ninguno es "más correcto" si ambos dan la respuesta correcta.
The "largest of three" algorithm runs on a=4, b=9, c=6. What does it output? · El algoritmo "mayor de tres" se ejecuta con a=4, b=9, c=6. ¿Qué devuelve?
Start 4; 9 > 4 → 9; 6 > 9 is false → stays 9. · Inicia con 4; 9 > 4 → 9; 6 > 9 es falso → permanece en 9.
Improving an algorithm step by step to be correct, clear, and efficient is called ______. · Mejorar un algoritmo paso a paso para que sea correcto, claro y eficiente se llama ______.
Refining follows testing, making the algorithm better each pass. · El refinamiento sigue a la prueba, haciendo que el algoritmo mejore en cada pasada.
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.
Refinar para la eficiencia
- Refinamos 改进 un algoritmo para que sea correcto, claro y eficiente 高效.
- Refinar significa mejorarlo paso a paso después de las pruebas.
El mayor de tres. largest ← a; SI b > largest: largest ← b; SI c > largest: largest ← c; MOSTRAR largest. Para a=4, b=9, c=6: empieza con 4; 9 > 4 → mayor 9; 6 > 9 es falso → se mantiene en 9. Salida 9. Esto utiliza secuenciación y selección.
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.
Un algoritmo es un conjunto finito de pasos, construido a partir de tres estructuras: secuenciación, selección e iteración. Puedes expresarlo como pseudocódigo, un diagrama de flujo o lenguaje natural. Diferentes algoritmos pueden dar el mismo resultado, por lo que los refinamos para que sean correctos, claros y eficientes.