Topic 1 Problem Solving Flashcards

1
Q

What is an algorithm?

A

A step-by-step procedure for solving a problem or carrying out a task. It is not programming code.

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

Why are algorithms needed?

A

To improve efficiency by removing the need for human input.

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

Describe the algorithm construct - SEQUENCE

A

Instructions provided and executed in the correct order.

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

Describe the algorithm construct - SELECTION

A

Choosing which part of an algorithm to run based on a condition being true or false.

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

Describe the algorithm construct - ITERATION

A

Steps in an algorithm are repeated for a set number of times, or until a condition is met.

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

How might algorithms be represented?

A

Pseudo-code / Flowcharts / Structured English.

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

What is Pseudo-code?

A

A way of expressing an algorithm in English, that resembles a computer language.

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

What is a flowchart?

A

A diagrammatic way of representing an algorithm using symbols/text linked with arrows to show the ‘flow’ through the algorithm.

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

In flowcharts, what symbol is used to represent the start/end?

A

Rounded rectangle.

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

In flowcharts, what symbol is used to represent a decision/selection

A

Diamond, with two possible outcomes, Yes/No, True/False etc.

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

In flowcharts, what symbol is used to represent a process?

A

Rectangle.

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

In flowcharts, what symbol is used to represent control passing between other symbols?

A

Arrow.

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

In flowcharts, what symbol is used to represent a subroutine?

A

Rectangle, with an extra line at both sides.

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

What is a dry-run?

A

Using a pen/paper to investigate the FUNCTIONING of an algorithm.

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

What is the purpose of a trace table?

A

To write down (pen/paper) the values of each variable during the execution of an algorithm.

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

What is meant by a syntax error?

A

An error in the language used, eg PINT instead of PRINT

17
Q

What is meant by a logic error?

A

An error which produces an incorrect result/output. Eg Multiplies instead of divides.

18
Q

What is meant by a run-time error?

A

An error that would cause the program to crash during execution. Eg divide by zero.

19
Q

Describe the linear search algorithm.

A

An attempt to find an item in an array which starts at the beginning of the array, checks each item in turn, stops when the item is found, or the end of the array is reached.

20
Q

Describe the binary search algorithm.

A

Array must be sorted first. Select the middle value and compare with the search item. If the search item is lower, discard the middle value and the higher items to the right. If the value is higher, discard the middle value and the lower items to the left. Repeat until the search item is found, or not in the list.

21
Q

Describe the bubble sort algorithm to sort into ascending order.

A

Go through the array starting at the second item. Compare this with the value before it. If first value is higher than second value, swap the items. Repeat this until all items are in their correct place.

22
Q

Describe the merge sort algorithm.

A

An array is divided into two repeatedly until each array has only one item. The arrays are then progressively merged with the items into the correct order.

23
Q

What is meant by decomposition?

A

Breaking a large problem down into sub-problems or components. These smaller components are easier to understand and solve. Once all of the components are solved, the large problem is solved.

24
Q

What is meant by abstraction?

A

Identifying the essential elements of a real world scenario needed for use in an algorithm/program, and ignoring all non-essential elements. Eg Google Maps shows roads/names/main buildings as opposed to a photograph in Google Earth which would show every detail.