Algorithms Flashcards
What is an algorithm?
It is a set of step by step instructions to solve a given problem.
What is pseudocode?
It is simplified half English, half code outline of a computer program/sequence of instructions.
Why would you use a flowchart and how would it help you?
It allows you to see problems before they arise. You can also clearly map out the problem you are trying to solve.
What does the start or stop mean in a flow chart?
It means the beginning and end points of a sequence.
What does process mean in a flow chart?
It means an instruction or command.
What does decision mean in a flow chart?
It means either yes or no.
What does input or output mean in a flow chart?
An input data is received by a computer. An output is a signal sent from a computer.
What does connector mean in a flow chart?
A jump from one point in the sequence to another.
What does directions of flow mean in a flow chart?
Connects the symbols. The arrow shows the direction of flow of instructions.
What are 3 ways you can tell a computer to organise a script?
- Sequencing
- Selection
- Iteration
What is sequencing?
It’s when the computer will run your code in order or one line at a time from the top to the bottom of your program. E.g. like command prompt. Everything is shown.
What is selection?
It’s when some lines of code are run but only if a condition is met, so some code is intentionally ignored. For example, IF else statements/switch statements. E.g. if over 18 selected show the adult web page. This is more complex than sequencing.
What is iteration?
This is when the computer executes the same lines of code several times. This is done using a loop. E.g. you have a video that plays every time someone visits your website you can specify how many times it plays.
What are the 3 types of loops in iteration?
- For loops
- While do loops
- Repeat loops
What are For Loops?
It’s used to repeat a specific block of code a known number of times. This is predetermined.