Problem Solving - 1.1 Algorithms Flashcards

You may prefer our related Brainscape-certified flashcards:
1
Q

What is an Unambiguous?

A

An instruction that cannot be misunderstood. Saying ‘turn’ will be an ambiguous instruction because you can turn left or right, while saying ‘turn left’ will be an Unambiguous instruction.

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

What is a Sequence?

A

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

A precise method for solving a problem. It is unambiguous, and can be made up of a sequence of steps.

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

How can algorithm be ‘successful’?

A

It has to be accurate - it must lead to the expected outcome (e.g. get an accurate route from Dubai Mall to Abu Dhabi airport.

It has to be Consistent - it must produce the same result each time it is run.

It has to be efficient - it must solve the problem in the shortest possible using as few computer resources as possible. E.g. Finds the shortest route possible from Dubai Mall to Abu Dhabi airport,

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

What is ‘High-level programming language’?

A

A programming language that resembles natural human language.

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

An example of a written description of an algorithm for making a cup of instant coffee is….

A
Fill kettle with water.
Turn on kettle.
Place coffee in cup.
Wait for water to reach 100 degrees.
Pour Water into cup.
Add milk and sugar.
Stir.
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

What is a flow chart?

A

A graphical representation of an algorithm. Each step 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
8
Q

What does the oval in a flowchart represent?

A

Indicates the start or end of an algorithm.

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

What does the rectangle in a flowchart represent?

A

Indicates a process to be carried out.

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

What does the triangle in a flowchart represent?

A

Indicates a decision to be made.

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

What does the parallelogram in a flowchart represent?

A

Indicates an input or an output.

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

What does the arrow in a flowchart represent?

A

Shows the logical flow of an algorithm.

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

What is pseudo-code?

A

In addition to flowcharts and written descriptions, algorithms can also be expressed in pseudo-code. Pseudo-code 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
14
Q

An example of pseudo-code is…..

A

SEND ‘Please enter the first number.’ TO DISPLAY
RECIEVE firstnumber FROM KEYBOARD
SEND ‘Please enter the second number.’ TO DISPLAY
RECIEVE secondnumber FROM KEYBOARD
SET total TO firstnumber + secondnumber
SEND total TO DISPLAY

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

What is a Variable?

A

a ‘container’ used to store data. The stored data in a variable is referred to as a value. The value stored in a variable is 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
16
Q

What is an identifier?

A

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
17
Q

What is an Arithmetic Operator?

A

An operator that performs a calculation on two numbers.

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

What does this Arithmetic Operator do: + ?

A

Addition : Adds values together. E.G. 8+5 = 13, myscore1 + myscore2.

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

What does this Arithmetic Operator do: - ?

A

Subtraction: subtracts the second value from the first. 17 - 4 = 13, e.g. myscore1 - myscore2

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

What does this Arithmetic Operator do: * ?

A

Multiplication: multiplies the values together. e.g. 6*2= 12. myscore1 * myscore2

21
Q

What does this Arithmetic Operator do: / ?

A

Real division: Real division: divide the first value by the second value and returns the result including decimal places.

22
Q

What does this Arithmetic Operator do: DIV ?

A

Quotient: like division, but it only returns the whole number or integer.

23
Q

What does this Arithmetic Operator do: MOD ?

A

Modulus/modulo: this will return the remainder of division.

24
Q

What does this Arithmetic Operator do: ^ ?

A

Exponent: to the power of.1

25
Q

What is a constant?

A

It is the opposite of a variable. A ‘container’ that holds a value that never changes. Like variables constants have there unique identifiers.

26
Q

What is a construct?

A

A component from which something is built. Letters and numbers (i.e. a-z and 0-9) are the constructs we use to build our language and convey meaning. Bricks and cement are the basic constructs of a building.

27
Q

What is selection?

A

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

28
Q

What is 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.

29
Q

What is a IF…THEN…ELSE statement?

A

The if then else statement allows a choice to be made between two alternatives based on whether or not a condition is met. (e.g. IF it is cold THEN wear a jumper ELSE wear a T-shirt.

30
Q

What is a relational operator?

A

An operator that compares 2 values.

31
Q

What is a nested IF statement?

A

A nested IF statement 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.

32
Q

What is an Indefinite iteration?

A

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

33
Q

What is Definite iteration?

A

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

34
Q

What is a logical operator?

A

A Boolean operator using AND, OR and NOT.

35
Q

What is a random number?

A

A number within a given range of numbers that is generated randomly.

36
Q

What is a loop?

A

A loop that runs inside another loop.

37
Q

What is a Concatenation?

A

The linking together of two or more items of information.

38
Q

What is a Logical error?

A

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

39
Q

What is a 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.

40
Q

Simulation:

A

a representation of a real world process or system.

41
Q

Infinite loop:

A

a loop that is never ending since the condition required to terminate the loop is never reached.

42
Q

Array:

A

an organised selection of related values that share a single identifier.

43
Q

Ascending order:

A

from smallest to largest.

44
Q

Descending order:

A

from largest to smallest.

45
Q

Traversal:

A

Travels through or across.

46
Q

Recursion:

A

a process that is repeated.

47
Q

Brute force:

A

an algorithm design that does not include any techniques to improve it…

48
Q

Divide and conquer:

A

an algorithm design that works by dividing a problem into smaller and smaller sub-problems, until they are easy to solve.

49
Q

Median:

A

the middle number.