Algorithms, flowcharts and pseudocode

விளையாடிக் கற்றுக்கொள்ளுங்கள்

ஆற்றல் சம்பாதிக்க இந்த கேள்விகளுக்குப் பதிலளியுங்கள், பின்னர் மீன் பிடித்து ஆராயுங்கள். கணக்கு தேவையில்லை.

கல்வியாளர்களுக்கு: Algorithms, flowcharts and pseudocode (KS3 Computing, Computer Science)-க்கான தயாரான பாட ஸ்லைடுகள், திருப்புதல் குறிப்புகள் — உங்கள் பாடத்தில் அவற்றைப் பயன்படுத்தவும், அல்லது கற்பவர்கள் நேரலை விளையாட்டாக விளையாடும் ஊடாடும் வகுப்பு செயல்பாடாக தலைப்பை இயக்கவும்.

பாட குறிப்புகள்

What is an Algorithm?

  • An algorithm is a precise sequence of instructions that solves a problem or performs a computation.
  • It must be finite – it stops eventually after a finite number of steps.
  • Algorithms are used as specifications for calculations and data processing.
  • They can be expressed in flowcharts, pseudocode, or a programming language.
  • A heuristic is a problem-solving approach without a well-defined correct result (e.g., social media recommendations).

An algorithm is a finite, unambiguous sequence of steps that turns an input into an output.

An algorithm is a finite, unambiguous sequence of steps that turns an input into an output.

Expressing Algorithms: Flowcharts

  • A flowchart uses standard symbols to show the steps of an algorithm visually.
  • Oval (terminator) – start and end of the algorithm.
  • Rectangle (process) – a calculation or action (e.g., 'Add 1 to count').
  • Diamond (decision) – a yes/no question that branches the flow.
  • Parallelogram (input/output) – reading data or displaying results.
  • Arrows show the flow of control between steps.

The standard flowchart symbols - terminal, process, input/output and decision - and the same logic written as pseudocode.

The standard flowchart symbols - terminal, process, input/output and decision - and the same logic written as pseudocode.

Expressing Algorithms: Pseudocode

  • Pseudocode is a plain-language description of an algorithm, not tied to a specific programming language.
  • It uses keywords like IF, THEN, ELSE, WHILE, FOR, INPUT, OUTPUT.
  • It is more precise than natural language but easier to read than code.
  • Example: `IF score ≥ 50 THEN OUTPUT "Pass" ELSE OUTPUT "Fail"`.
  • Pseudocode helps plan and communicate algorithms before coding.

Pseudocode keywords for input, output, assignment and selection, with the same logic drawn as a flowchart.

Pseudocode keywords for input, output, assignment and selection, with the same logic drawn as a flowchart.

Tracing an Algorithm

  • Tracing means manually following the steps of an algorithm with sample inputs to check it works.
  • Use a trace table with columns for variables, conditions, and output.
  • Record the value of each variable after every step.
  • Tracing helps find logic errors and verify correctness.
  • Example: trace a loop that sums numbers from 1 to 5 – track `sum` and `i`.

A trace table records one row per step: the input taken, the variable values, the decision made and any output.

A trace table records one row per step: the input taken, the variable values, the decision made and any output.

Precision and Avoiding Ambiguity

  • Algorithms must be unambiguous – each step has exactly one meaning.
  • Vague instructions like 'add a few' are not algorithmic.
  • Use clear, specific language: 'Add 1 to count' not 'increase count'.
  • Flowcharts and pseudocode reduce ambiguity by using structured symbols and keywords.
  • A well-defined algorithm has a clear start, finite steps, and defined output.

Steps in the wrong order give the wrong result even when every step is correct.

Steps in the wrong order give the wrong result even when every step is correct.

History of Algorithms

  • Algorithms date back to ancient civilizations: Babylonian (c. 2500 BC), Egyptian (c. 1550 BC), Indian, Greek, Chinese, and Arabic.
  • The Euclidean algorithm (c. 300 BC) finds the greatest common divisor.
  • The Sieve of Eratosthenes (c. 240 BC) finds prime numbers.
  • Al-Khwarizmi (9th century) formalized algorithms as systematic, finite steps; the word 'algorithm' comes from his name.
  • Al-Kindi developed the first cryptographic algorithm using frequency analysis.

Key Takeaways

  • An algorithm is a step-by-step recipe for a computer or human to follow.
  • Flowcharts and pseudocode are two ways to represent algorithms.
  • Always trace your algorithm to ensure it works for all inputs.
  • Precision is key – avoid ambiguity.
  • Algorithms are fundamental to computer science and problem-solving.

One algorithm written three ways: structured English, pseudocode and a flowchart.

One algorithm written three ways: structured English, pseudocode and a flowchart.

ஸ்லைடுகள்

Sign up free to view the lesson slides

Step through every slide for this topic — plus flashcards and revision notes — with a free account.

பயிற்சி கேள்விகள்

இலவச முன்னோட்டம் — 57-இல் 8 கேள்விகள். அனைத்தையும் பார்க்க பதிவு செய்யவும்.
  1. 1.What is an algorithm?

    Easy
    • AA precise sequence of instructions to solve a problem
    • BA random set of steps that may or may not work
    • CA type of computer hardware
    • DA programming language
  2. 2.An algorithm must always terminate (stop eventually).

    Easy

    True or false?

  3. 3.Which of the following is NOT a standard flowchart symbol?

    Easy
    • AOval
    • BRectangle
    • CDiamond
    • DTriangle
  4. 4.In a flowchart, what does a diamond shape represent?

    Easy
    • AA process
    • BA decision
    • CInput/output
    • DStart or end
  5. 5.Match each flowchart symbol to its meaning.

    Easy
    • Oval
    • Rectangle
    • Diamond
    • Parallelogram
    • Start/End
    • Process
    • Decision
    • Input/Output
  6. 6.Pseudocode is written in a specific programming language such as Python.

    Easy

    True or false?

  7. 7.Which of the following is an example of an algorithm?

    Medium
    • AA recipe for baking a cake
    • BA random guess at a number
    • CA list of your favourite songs
    • DA painting of a landscape
  8. 8.Arrange the following steps to make a simple algorithm for making a cup of tea:

    Medium
    • Boil water
    • Add tea bag to cup
    • Pour water into cup
    • Remove tea bag

Unlock all 57 questions, flashcards & more

இந்த தலைப்பிற்கான ஒவ்வொரு கேள்வியையும், ஸ்லைடுகளையும், ஃப்ளாஷ் கார்டுகளையும் மற்றும் திருப்புதல் குறிப்புகளையும் பார்க்க இலவச கணக்கை உருவாக்கவும்.

முந்தைய தேர்வுகள்

இந்த தலைப்பிற்கான முந்தைய தேர்வு பயிற்சி விரைவில் வருகிறது.
விரைவில் வருகிறது