🚀
ArkyEdu GLOSAR TIC
RO Practice Lab
Algorithms, C++ & Scratch Grades 5–8 RO Term: Algoritm și Proprietățile Algoritmilor

Algorithm & Core Algorithm Properties

💬 Share on WhatsApp
📌 Quick Definition (Answer-First)

An algorithm is a finite, unambiguous, step-by-step set of instructions that transforms input data into the desired output within a finite number of steps.

How It Works & Why It Matters

School computer science teaches three key properties: Precision (no ambiguous steps), Generality (works for any valid inputs, not just one hardcoded example), and Finiteness (always terminates).

Every algorithm can be built using just three control structures: sequence, selection (if/else), and iteration (loops).

💻 Three Fundamental Control Structures
1. Sequence (Linear):   Step 1 -> Step 2 -> Step 3
2. Selection (Branch):  if (condition) { ... } else { ... }
3. Iteration (Loop):    while (...) { ... }  /  for (...) { ... }

🏫 Classroom Example

Calculating an average: read 3 test scores -> compute sum -> divide sum by 3.0 -> print result.

⚖️ Algorithm vs. Source Code

An algorithm is the abstract logical method; a program implements that algorithm in a concrete language like C++ or Scratch.

⚠️ Common Mistake in Exams & Homework

Writing an infinite while loop that forgets to update its counter or condition, violating finiteness.

❓ Quick Questions & Answers

Can all programs be written using only sequence, selection, and loops?
Yes, according to the structured program theorem, any computable algorithm can be expressed with those three structures.

Related Glossary Terms

← Back to Full Glossary (A–Z)