1.2 Algorithms Flashcards
Why is it important for an algorithm’s instructions to be unambiguous?
To make sure there is only one way of interpreting the instructions
What is an algorithm?
A set of instructions for performing a specific task
How can you show an algorithm?
Flow charts, pseudocode or written instructions
Why is breaking down an algorithm into basic parts important?
It makes the solution clearer and ensures each step can be easily followed
When is a flow chart more suitable than pseudocode?
When you need to convey your messages to non-specialists
When is pseudocode more suitable than a flow chart?
When you are trying to display more complicated algorithms
What is syntax in programming?
The way a program must be laid out for the computer to understand it
Why must instructions in an algorithm be sequenced properly?
Instructions execute in the order they are written, so incorrect sequencing can cause errors
What is selection in programming?
Asking questions to control the flow of the program. I.e. if statements
What is iteration in programming?
Repeating a task multiple times. I.e. for and while loops