Algorithms Flashcards

1
Q

What is an algorithm?

A

A sequence of logical instructions for carrying out a task.

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

What are two common methods for designing algorithms?

A

Pseudo-code and flowcharts.

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

What do algorithms focus on when being designed?

A

The logic of the steps.

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

What is meant by ‘language independent’ in the context of algorithms?

A

Programmers should be able to translate an algorithm into any programming language.

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

Fill in the blank: An algorithm can be designed using _______ and/or flowcharts.

A

pseudo-code

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

True or False: Algorithms are specific to a programming language.

A

False

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

What is the purpose of using statements and expressions in algorithms?

A

To provide clear instructions for solving a problem.

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

What is pseudo-code?

A

A method of writing up a set of instructions for a computer program using plain English.

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

What is a flowchart?

A

A diagram that shows the step-by-step flow of an algorithm.

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

What is a statement in an algorithm?

A

The smallest element of a programming language which expresses an action to be carried out.

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

What is a programming language?

A

A language used by a programmer to write a piece of software.

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

What is decomposition?

A

Breaking down a complex problem or system into smaller parts that are more manageable and easier to understand.

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

What is abstraction?

A

The process of extracting or withdrawing something eg. The underground Map

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

Psuedo-code can be broken into three sections. What are they?

A

Inputs
Processes
Outputs

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

What is assignment?

A

Setting the value of a variable in a computer program.

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

What is a variable?

A

A memory location within a computer program where values are stored.

17
Q

What are data?

A

Units of information. In computing there can be different data types, including integers, characters and Boolean.

18
Q

What symbols should be used for pseudo-code?
Line

A

It represents the flow from one component to the next.
An arrow.

19
Q

What symbols should be used for pseudo-code?
Process

A

An action.
A rectangle.

20
Q

What symbols should be used for pseudo-code?
Subroutine

A

Calls a subroutine,
A rectangle.

21
Q

What symbols should be used for pseudo-code?
Input / Output

A

Calls an input or an output.

A squashed rectangle.

22
Q

What symbols should be used for pseudo-code?
Decision

A

A yes/no/true/false decision.
A kite shape.

23
Q

What symbols should be used for pseudo-code?
Terminator

A

The start or end of the process,
A rounded rectangle.

24
Q

What is an input?
eg. in pseudo-code
myVar <– Input

A

Data which is inserted into a system for processing and/or storage as a variable.

25
What is an output?
Data which is sent out of a system and shown to the user.
26
How does a program communicate with the user?
The user must input data into the system This data must be processed The outcome is output to the user The data is stored for later use
27
What does a dry run mean?
Dry running an algorithm means to assign the values to variables of an algorithm and to do any processing that takes place without translating it into code.
28
What is a trace table?
Used when testing a program to record changes in variable values as code executes.
29
What is a standard algorithm?
A commonly agreed programming solution to a specific problem.
30
What does bubble sort mean?
A sorting algorithm that repeatedly passes through a list to be sorted, comparing and swapping items that are in the wrong order.
31
What does merge sort mean?
A sorting algorithm that repeatedly divides a list in half until each has only one item. The individual lists are then merged.
32
What does efficiency look at?
Efficiency looks at how much time it takes to run a particular algorithm and how much space is needed.
33
What is an array?
A set of data values of the same type, stored in a sequence in a computer program. Also known as a list.