2.3.1 - Analysis, Design + Comparison Flashcards

(18 cards)

1
Q

Two pieces of info that let you analyse an algorithm

A

Time + Space complexity

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

What’s meant by the time complexity of algorithms

A

The amount of time required to solve a problem

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

How is time complexity measured

A

Using big o notation

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

What does the big o notation show

A

The effectiveness of an algorithm

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

What’s big o notation good for

A

Predicting the amount of time taken to solve an algo given the num of items stored

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

What’s a linear time complexity

A

Amount of time taken = num of elements inputted

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

What’s a constant time complexity

A

Amount of time taken to complete an algorithm is independent to the number of inputted elements

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

What’s a polynomial time complexity

A

Amount of time taken to complete an algorithm is proportional to number of items inputted to power of n

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

What’s an exponential time complexity mean

A

Amount of time taken to complete an algorithm is proportional to 2 to the power of num of items inputted

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

Log time complexity mean?

A

Time taken to complete an algorithm increases 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
11
Q

What’s a logarithm

A

How many times a certain number is multiplied together to reach another number

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

What’s space complexity

A

Space complexity is the amount of storage space an algorithm takes up

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

What’s an algorithm

A

An algorithm is a sequence of instructions to complete a task

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

How do you reduce space complexity

A

Try complete all operations on same data set

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

How do you reduce the time complexity of an algorithm

A

You reduce the amount of embedded for logos and then reduce the amount of item you complete the operations on same => divide and conquer

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

Big o notation of linear search algotitm

17
Q

Big o notation of binary search algorithm

18
Q

Big o notation of bubble sort algorithm