# 9.1 Algorithmic thinking Flashcards

1
Q

﻿1.1 What is an algorithm?

A

A sequence of instructions to solve a problem or achieve a goal.

2
Q

1.2 What is searching?

A

Searching is where the programs checks through a list looking to find a piece of data. (E.g. looking for a name in a list.)

3
Q

1.3 How does a linear search work?

A

A linear search starts with the first item in the list and checks each one in turn to see if it matches the data being searched for.

4
Q

1.4 How does a binary search work?

A

A binary search checks the middle value in the list. If that middle item is higher than the search value it disregards the top half of the list. Then it checks the middle of the remaining values. This process repeats until the value is found, or no data remains.

5
Q

4.1 Pseudocode definition

A

Pseudocode is a way to design algorithms. It uses commands which are similar to those in a computer program, but is not as rigid, as it is only intended for planning the steps involved.

6
Q

4.2 Why won’t pseudocode run on a computer?

A

Pseudocode is a design tool. Just like you can’t drive the design of a car or live in an architect’s design of a house.

7
Q

4.3 Trace table definition

A

A trace table is used to test if an algorithm written in pseudocode works properly.

8
Q

4.4 Why do you need trace tables?

A

Because pseudocode is not a working computer program, you cannot run it to test it. Instead you follow the pseudocode, writing down the values it generates and outputs.

9
Q

2.1 Input

A

Identifier ß USERINPUT

10
Q

2.2 Output

A

OUTPUT “Data” + variable

11
Q

2.3 Assignment

A

identifier ß data

12
Q

2.4 Selection

A

IF condition THEN

13
Q

2.5 Count controlled iteration

A

FOR i ß 1 to 10

14
Q

2.6 Condition controlled iteration

A

WHILE condition

15
Q

2.7 Arithmetic

A

+ - * /

16
Q

2.8 Relational operators

A

< > = ≤ ≥ ≠

17
Q

2.9 Random Number Generation

A

RANDOM_INT(int, int) (Ints are inclusive lower and upper bounds)