Flashcards in 1 - Fundamentals of Algorithms Deck (27):

1

##
What is an algorithm?

(e.g. directions)

### An algorithm is a sequence of steps that can be followed to complete a task. A computer program is an implementation of an algorithm and an algorithm is not a computer program

2

##
What is decomposition?

(e.g. recipe)

### Decomposition is breaking a problem into a number of sub-problems, so that each sub-problem achieves an identifiable task, which might itself be further subdivided

3

##
What is abstraction?

(e.g. London tube map)

### Abstraction is the process of removing unnecessary detail from a problem

4

## What is a model for how a computer operates?

### The input-process-output model helps to show how a computer operates.

5

## What is the input stage in a computer, and where does it take place in the algorithm?

### The input stage is the flow of data into the process from outside the system. It takes place at the start of the algorithm

6

## What is the process stage in a computer, and where does it take place in the algorithm?

### The process stage includes all the tasks required to affect a transformation of the inputs. It takes place in-between the input and output stage

7

## What is the output stage in a computer, and where does it take place in the algorithm?

### The output stage is where the data and information flow out of the transformation process, and it takes place at the end of the algorithm

8

## What are flowcharts?

### Flowcharts are diagrams that represent an algorithm

9

## What does the flow line mean?

### The flow line shows the sequence of operations. These must go in through one box and out of the other.

10

## What does a terminal symbol mean?

### The terminal symbol denotes the start or end of the algorithm

11

## What does the processing symbol mean?

### The processing symbol denotes a process to be carried out

12

## What does a decision symbol mean?

### A decision symbol is used to represent the operation in which there are 2 alternatives

13

## What structures can be used for flowcharts?

### Sequence, Selection and Iteration structures

14

## What is pseudocode?

### Pseudocode is a way of developing an algorithm, which consists of natural language-like statements that precisely describe the steps required

15

## What are assignment operators?

### Operators that set the value of the variable in pseudocode

16

## How do you input something in pseudocode?

### VAR

17

## How do you output something in pseudocode?

### OUTPUT (or PRINT, DISPLAY, SHOW, RETURN) 'information'

18

## How do you process or compute something in pseudocode?

### COMPUTE, CALCULATE, DETERMINE

19

## How do you comment on your pseudocode?

### By using # key

20

## How do you add selection in pseudocode?

### By using IF, THEN, ELSE, ENDIF statements

21

## How do you represent pseudocode as a flowchart (and vice versa)?

### By matching each statement with whether it is an input, output, process, terminal or decision statement

22

## How do we use a trace table to identify how simple algorithms work?

### A trace table is a technique used to see if any logic errors are occurring whilst the algorithm is being processed

23

## How can visual inspection be used to see how a simple algorithm works?

### By looking at it to see if any logic errors occur based on the expected outcome and the actual outcome of the algorithm

24

## What types of loops can be used in pseudocode?

### FOR loop, WHILE loop, REPEAT ... UNTIL loop

25

## When will you use a FOR loop and how should you use it?

###
You use a FOR loop when you know how many times you want a loop to repeat:

E.g.

FOR I

26

## When will you use a WHILE loop and how should you use it?

###
You use a WHILE loop when you loop a code based on a certain condition, which is checked at the start:

e.g.

WHILE a < 5

OUTPUT a

ENDWHILE

27