Paper 1: 3.1 Fundamentals of algorithms Flashcards

1
Q

What is an algorithm?

A

A set of rules followed by a computer to solve a problem

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

A computer program is the implementation of an _________

A

Algorithm

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

What is abstraction?

A

Getting rid of unnecessary detail

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

What shape is an input/output in an algorithm?

A

Rhombus

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

What shape is a start/end in an algorithm?

A

Rectangle with semi circle on each end

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

What is the shape of a process in an algorithm?

A

Rectangle

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

What is the shape of a decision is an algorithm?

A

Diamond

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

What is the purpose of an algorithm?

A

To solve a problem

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

How do you compare the efficiency of an algorithm?

A

The shorter algorithm is better if they solve the same problem

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

How does linear search work?

A

It sequentially checks each element of the list for the target value until a match is found or until all the elements have been searched

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

How does binary search work?

A

Chops the list in half, if it is bigger it gets rid of the other side and repeats until the value is found (must be in order)

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

How does merge sort work?

A

You split up the list and put it back together in order (merging it)

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

How does bubble sort work?

A

Look at the first two, check if they’re in the right order. If not, swap them. Repeat with other pairs until it is fully sorted.

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