Term 1 | Practical | Chapter 1 Flashcards

1
Q

What is an algorithm?

A

an ordered list of steps for carrying out a task or solving a problem.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

What are the criteria that an algorithm should have

A

● there must be a limited number of steps
● the steps must be:
 easy to understand and follow
 detailed and specific
 clear and unambiguous
● each step should:
 consist of a single task
 be at the most basic level that cannot be broken into simpler tasks
● all repetitions must have clear ending conditions
● there must be at least one result (or output).

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

What are the 2 criteria you require to evaluate the quality of an algorithm?

A

● precision

● order

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

What does precision refers to in an algorithm

A

Precision refers to how accurately and reliably an algorithm solves a
problem. The more precise an algorithm is, the better it is at solving the
problem correctly regardless of the situation.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

What does order refers to in an algorithm

A

Order refers to the total number of steps needed (including repeats) to complete an algorithm. The order
of an algorithm is usually shown as a mathematical formula based on the number of inputs.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

What are the steps of creating a high quality algorithm

A

● Understanding the problem
● Defining the desired solution or output
● Defining the inputs
● Designing a set of steps to complete the task
● Testing the algorithm
● Updating the algorithm:

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

What is a flowchart?

A

A flowchart is a visual representation of an algorithm. It can be made up of five different elements

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

What are the 5 elements in a flowchart and their function?

A

Terminal Indicates the start and end of an algorithm.
Begin / End

Input/Output Shows when data is added to the algorithm or given to the user.

Instruction Gives an instruction that the algorithm must follow.

Decision Shows a decision (or condition) that affects the algorithm’s behavior.

Connector
Connects one element of the algorithm to the next element. Shows
the direction in which you move from one element to the next

How well did you know this?
1
Not at all
2
3
4
5
Perfectly