1.2.1 + 1.2.4 What algorithms are and how they are expressed The purpose of a given algorithm and how it works Flashcards

1
Q

Define:

Algorithm

A

A well-defined set of step-by-step instructions to solve a problem

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

Fill The Blank:

An algorithm is language ………………

A

Independent

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

State:

Give 4 requirements of an algorithm

A
  • Clear
  • Clear defined outputs and inputs
  • Simple
  • Language independent
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

State:

3 advantages of an algorithm

A
  • Easy to understand by anyone
  • Step by step representation of a solution to a given problem
  • Initial problem is broken down into steps, which means it is easier to convert into code
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

State:

2 disadvantages of algorithms

A
  • Can be time consuming to create
  • Some constructs can be difficult to represent
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

State:

The 4 ways an algorithm can be represented

A
  • Flowchart
  • Written Description
  • Pseudocode
  • Program Code
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

Define:

Flowchart

A

Graphical diagram that represents an algorithm which can be used to solve a problem

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

State:

2 advantages of using a flowchart to represent an algorithm

A
  • Flow of the algorithm can be seen clearly
  • Flowcharts are created using a standardised set of symbols so can be interpreted and understood by many people
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

State:

2 disadvantages of using a flowchart to represent an algorithm

A
  • Can become large and difficult to follow when representing a large program
  • Changes to design may result in the flowchart being amended or redrawn
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

Fill The Blank:

Written descriptions should be in …………… language or plain English. There is no set of …….. to follow when using written description but they should be …….., ……… and contain few/no specific ………

A

Natural, Rules, Clear, Simple, Details

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

State:

2 advantages of using a written description to represent an algorithm

A
  • No formal syntax, so many people can create a written description
  • Automatic and natural to use ‘proper’ English
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

State:

2 disadvantages of using a written description to represent an algorithm

A
  • Temptation to create a complete description (complicating it)
  • Failure to include every step required
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

Define:

Pseudocode

A

An informal description that shows the flow of an algorithm and follows a similar structure to high level languages

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

State:

3 advantages of using pseudocode to represent an algorithm

A

3 of:
* Can be converted into programming code with only minor changes to obey syntax of the language
* Can be easy to follow and understand even if errors are present in the pseudocode
* Changes can be added in quickly
* Can act as a link between the algorithm and the final program
* Explains the purpose of each line of code

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

State:

2 disadvantages of using pseudocode to represent an algorithm

A
  • Can be time consuming to write clear and well structured pseudocode to write the final program code
  • Can be difficult to see the logical flow of the program
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
16
Q

Define:

Program Code

A

Code written to solve the problem which follows the rules of a selected programming language

17
Q

State:

3 advantages of using (draft) program code to represent an algorithm

A
  • Very probable the person creating the algorithm will have programming knowledge
  • Not necessary to use the correct syntax
  • All the required constructs will be available to be included in draft code
18
Q

State:

2 disadvantages of using program code to represent an algorithm

A
  • Easy to begin creating draft code but end up creating the final program code
  • Full decomposition may not be completed
19
Q

Define:

Dry Run

A

Manually working through the code to trace the value of variables

20
Q

Define:

Trace Table

A

Tool used to test or dry run algorithms to make sure no logical errors occur while calculations are being processed

21
Q

State:

2 ways to test/check an algorithm works

A
  • Visual Check
  • Trace Table
22
Q

State:

2 advantages of using pre-written/library code

A

2 of:
* Save development time
* Save testing time
* Will be optimised (more efficient and error free)

23
Q

State:

1 disadvantage of using pre-written/library code

A

It may not be exactly what is required and may require editing to work for an unique problem

24
Q

Fill The Blank:

A ……….. check can be used to determine the purpose of the algorithm using pseudocode

A

Visual