2.3.1 - Analysis, Design and Comparison of Algorithms Flashcards

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

What are the two features that must be considered when designing an algorithm?

A

Time complexity and space complexity.

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

What is time complexity?

A

How much time it takes to solve a particular problem.

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

What is space complexity?

A

The amount of storage the algorithm takes up.

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

What is Big-O notation?

A

A way of representing the time complexity of an algorithm.

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

What are the five types of Big-O notation?

A

Constant

Linear

Polynomial

Exponential

Logarithmic

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

How is a constant time complexity written in Big-O notation?

A

O(1).

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

How is a linear time complexity represented in Big-O notation?

A

O(n).

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

How is a polynomial time complexity written in Big-O notation?

A

O(nn).

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

How is exponential time complexity written in Big-O notation?

A

O(2n)

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

How is logarithmic time complexity represented in Big-O notation?

A

O (log n).

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

What does a constant time complexity mean?

A

The amount of time taken to complete an algorithm is independent of the number of elements inputted.

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

What does a linear time complexity mean?

A

The amount of time taken to complete an algorithm is directly proportional to the number of elements inputted.

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

What does polynomial time complexity mean?

A

The amount of time taken to complete an algorithm is directly proportional to the elements inputted to the power of n.

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

What does exponential time complexity mean?

A

The amount of time taken to complete an algorithm will double with every additional item.

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

What is logarithmic time complexity?

A

The time taken to complete an algorithm will increase at a smaller rate as the number of elements inputted.

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

When would prioritising time complexity be useful?

A

If there is lots of data but the data needs to be processed quickly.

17
Q

When would prioritising space complexity be useful?

A

If the computer has a lot of processing power.