Analysis, Design and comparison Flashcards

1
Q

What is time complexity?

A

The amount of time that an algorithm will take to solve a problem

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

What does the Big-O time complexity show?

A

The maximum amount of time that an algorithm will take relative to the number of inputs

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

What is Big-O(1)?

A

Constant time complexity - Time taken in independent from the number of inputs

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

What is Big-O(n)?

A

Linear time complexity - The time taken is directly proportional to the number of inputs

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

What is Big-O(n^k)?

A

Polynomial time complexity - The time taken is directly proportional to the number of inputs to the power k

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

What is Big-O(2^n)?

A

Exponential time complexity - The time taken doubles with every additional input

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

What is Big-O(log(n))?

A

Logarithmic time complexity - The time taken increases at a falling rate

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

Order the time complexities from best to worst

A
  • O(1)
  • O(log(n))
    -O(n)
    -O(n log(n))
  • O(n^2) / O(2^n)
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

What is space complexity?

A

The amount of space that an algorithm requires to solve a particular problem

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

What is an algorithm?

A

A series of steps to solve a problem

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

How can space complexity be reduced?

A

The algorithm completes all operations on the original piece of data

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

How can time complexity be reduced?

A

The algorithm completes operations on as few number of items as possible

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