# 2.1 Algorithms Flashcards

You may prefer our related Brainscape-certified flashcards:
1
Q

What is an algorithm?

A

A sequence of logical instructions for carrying out a task.

2
Q

What is a program?

A

A sequence of instructions for a computer.

3
Q

What is abstraction?

A

Ignoring unnecessary detail in a problem in order to focus on the important and relevant information.

3
Q

What is computational thinking?

A

Solving problems logically, in a way that can be understood by humans and computers.

4
Q

What is decomposition?

A

Breaking a complex problem down into smaller sub problems to make it easier to solve

6
Q

What is sequence?

A

The order in which the steps are executed.

7
Q

What is pattern recognition?

A

Finding similarities and patterns in order to solve complex problems more efficiently.

8
Q

What is selection?

A

Decision making that decides which path the algorithm will take next.

9
Q

What is iteration?

A

Repeating steps.

10
Q

What is definite iteration?

A

Repeating steps a set number of times.

eg for loops

11
Q

What is a linear search?

A

Goes through data one by one to find the required item

+ Works with an unordered list
- Slower/less efficient than other searching algorithms

12
Q

What is a binary search?

A

Compares the required item to middle of the list, discards the irrelevant half of the list, repeats until the required item is found

+ Fast/efficient

• Only works in an ordered list
• Only works with numbers
13
Q

What is a bubble sort?

A

Looks at the first pair of data, swaps them round if in the wrong order, repeats with next pair

+ Doesn’t use much memory

• Doesn’t cope well with large lists
• Slower/less efficient than merge sort
14
Q

What is a merge sort?

A

“Divide and conquer” method, splits list in half and half again until lists contain only one value, merges small lists back together in the right order.

+ Quick/efficient
- Uses more memory than other sorting algorithms

15
Q

What is an insertion sort?

A

Looks at the second item in the list, compares it to all the items before it, repeats with the next item

+ Doesn’t use much memory
- Doesn’t cope well with large lists