1.1 Algorithms Flashcards

1
Q

What does ‘unambiguous’ mean?

A

It means that the instructions cannot be misunderstood.
Simply saying “turn” would be ambiguous because you can turn either left or right.
All instruction given on a computer must be unambiguous, otherwise, it would not know what to do.

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

What is a ‘sequence’?

A

It is an ordered set of instructions.

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

What is an ‘algorithm’?

A

It is a precise method for solving a problem.

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

What is ‘High-level programming language’?

A

It is a programming language that resembles natural human language.

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

What is a ‘flowchart’?

A

It is a graphical representation of an algorithm.
Each of the steps in the algorithm is represented by a symbol. Symbols are linked together with arrows showing the order in which steps are executed.

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

What is a ‘pseudo-code’?

A

It is a structured, code-like language that can be used to describe an algorithm.

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

What is a ‘variable’?

A

It is a ‘container’ used to store data.
The data stored in a variable is referred to as a value.
The value stored in a variable in not fixed. The same variable can store different values during the course of a program and each time a program is run.

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

What is an ‘identifier’?

A

It is a unique name given to a variable or a constant. Using descriptive names for variables makes code much easier to read.

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

What is an ‘arithmetic operator’?

A

It is an operator that performs a calculation on two numbers.

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

What is a ‘constant’?

A

It is a ‘container’ that holds a value that never changes.

Like variables, constants have unique identifiers.

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

Construct

A

A component from which something is built.

Letters and numbers are the constructs we use to build our own language and convey meaning.

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

Selection

A

A construct that allows a choice to be made between different alternatives.

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

Iteration

A

A construct that means the repetition of a process.

An action is repeated until there is a desired outcome or a condition is met. It is often referred to as a loop.

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

IF…THEN…ELSE statement

A

This statement allows a choice to be made between 2 alternatives based on whether or not a condition is met.

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

Relational operator

A

An operator that compares 2 values.

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

Nested IF statement

A

It consists of one or more IF statements placed inside each other. A nested IF is used where there are more than 2 possible courses of action.

17
Q

Indefinite iteration

A

This is used when the number of iterations is not known before the loop is started. The iterations stop when a specified condition is met.
This sort of loop is said to be condition controlled.

18
Q

Definite iteration

A

This is used when the number of iterations, or turns of the loop, is known in advance. It can be sent as many times as you want. This sort of loop is said to be count controlled.

19
Q

Logical Operator

A

A Boolean operator using AND, OR and NOT.

20
Q

Random number

A

A number within a given range of numbers that is generated in such a way that each number in the range has an equal probability of occurring.
There are many devices for generating n=random numbers. For example in Excel, it has a built-in RANDOM command: RANDOM(uppperLimit)

21
Q

Nested loop

A

A loop that runs inside another loop. The inner one executes all of its instructions for each turn of the outerloop.

22
Q

Concatenation

A

The linking together of 2 or more items of information.

23
Q

Logic error

A

An error in an algorithm that results in incorrect or unexpected behavior.

24
Q

Trace table

A

A technique used to identify any logic errors in algorithms. Each column represents a variable or output and each row a value of that variable.

25
Q

Simulation

A

A representation of a real world process or system.

26
Q

Array

A

An organised collection of related values that share a single identifier.

27
Q

Traversal

A

Travel across or through something. An array can be traversed by moving from the first to the last element in order to examine the data stored at each index position.

28
Q

Recursion

A

A process that is repeated. For example, a document can be checked and edited, checked and edited and so on until it is perfect.

29
Q

Brute force

A

An algorithm design that does not include any techniques to improve performance, but instead relies on sheer computing power to try all possibilities until the solution to a problem is found.

30
Q

Divide and conquer

A

An algorithm design that works by dividing a problem into smaller sub-problems, until they are easy to solve. The solutions to these are then combined to give a solution to the complete problem.

31
Q

Median

A

The middle number when numbers are ordered in ascending or descending order.