2.1 Algorithms Flashcards

1
Q

Computational thinking

A

The thought processes involved in formulating a problem and expressing its solution is such a way that a computer - human or machine - can effectively carry out.

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

Abstraction

A

The process of separating ideas from specific instances of those ideas at work. Computational structures are defined by their meanings, while hiding away the details of how they work. Abstraction tries to factor out details from a common pattern so that programmers can work close to the level of human thoughts, leaving details which matter in practise, but are immaterial to the problem being solved.

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

Decomposition

A

The process by which a complex problem or system is broken down into parts that are easier to conceive, understand, program and maintain.

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

Algorithmic thinking

A

A way of getting to a solution by identifying the steps needed.

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

Problem inputs

A

Any information or data which goes into a system.

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

Problem processes

A

Anything which happens to data during a system running e.g. Performing calculations.

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

Problem outputs

A

Any information or data which leaves a system.

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

Structure diagram

A

A diagram that looks like an upside down tree, with one node at the top (root) and many below. It is used when designing solutions to problems in order to help break a large problem down into a number of small parts.

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

Pseudocode

A

A language independent description of the steps of an algorithm. Intended for human to express and design algorithms before coding.

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

Flowchart

A

A method of designing algorithms before coding using symbols.

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

Trace table

A

A technique used to test algorithms, in order to make sure that no logical errors occur while the algorithms being processed. The table usually has one column for each variable. Each row of the table shows how the various values held variables change as the algorithm is running.

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

Searching algorithms

A

An algorithm which attempts to find a given value in a data set.

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

Binary search

A

A particularly efficient search method. It only works if records in the file are in sequence. A binary search involves accessing the middle record of the file and determining if the target record has been found or, if not, if it is before or after it in the sequence. This process is repeated on the part of the file where the target record is expected until it is found.

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

Linear search

A

Involves examining each entry in turn in the file until the time is found or the end of the file is reached. Unless the files are in some useful order, a serial search has to be used.

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

What is an example of abstraction in real life?

A

A map

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

What is an example of decomposition in real life?

A

Crossing a road

17
Q

What is an example of algorithmic thinking in real life?

A

Solving a word search.

18
Q

Syntax error

A

A mistake in the grammar or the code. It stops the program from running.

19
Q

Logic error

A

An error that gives an unexpected output. This does not stop the program from running.

20
Q

Runtime error

A

An error that occurs whilst the program is running. Runs the program until the error occurs.

21
Q

Examples of syntax errors.

A

No colon or incorrect indentations

22
Q

Examples of logic errors.

A

< instead of >, AND instead of OR.

23
Q

Example of runtime error.

A

An invalid input by the user

24
Q

Identify and fix this error:
print(hello)

A

It is a syntax error, it should be
print(“hello”)

25
Q

Identify and fix this error:
if age < 18:
print(“You are old enough to vote”)

A

The error is a logic error, it should be:
if age > 18:
print(“You are old enough to vote”)

26
Q

Identify and fix this error:
if age > 18
print(You are old enough to vote)

A

There are multiple syntax errors, it should be:
if age > 18:
print(“You are old enough to vote”)

27
Q
A