Topic 1 Problem Solving Flashcards
What is an algorithm?
A step-by-step procedure for solving a problem or carrying out a task. It is not programming code.
Why are algorithms needed?
To improve efficiency by removing the need for human input.
Describe the algorithm construct - SEQUENCE
Instructions provided and executed in the correct order.
Describe the algorithm construct - SELECTION
Choosing which part of an algorithm to run based on a condition being true or false.
Describe the algorithm construct - ITERATION
Steps in an algorithm are repeated for a set number of times, or until a condition is met.
How might algorithms be represented?
Pseudo-code / Flowcharts / Structured English.
What is Pseudo-code?
A way of expressing an algorithm in English, that resembles a computer language.
What is a flowchart?
A diagrammatic way of representing an algorithm using symbols/text linked with arrows to show the ‘flow’ through the algorithm.
In flowcharts, what symbol is used to represent the start/end?
Rounded rectangle.
In flowcharts, what symbol is used to represent a decision/selection
Diamond, with two possible outcomes, Yes/No, True/False etc.
In flowcharts, what symbol is used to represent a process?
Rectangle.
In flowcharts, what symbol is used to represent control passing between other symbols?
Arrow.
In flowcharts, what symbol is used to represent a subroutine?
Rectangle, with an extra line at both sides.
What is a dry-run?
Using a pen/paper to investigate the FUNCTIONING of an algorithm.
What is the purpose of a trace table?
To write down (pen/paper) the values of each variable during the execution of an algorithm.