'Fast' exponential and Pseudo polynomial algorithms Flashcards

1
Q

What do we mean by a fast exponential?

A

Where instead of 2^n runtime, we get a base less than 2. For example, 1.5^n

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

Why is it more important to develop fast algorithms over getting faster hardware?

A

As due to the nature of exponentials, even hardware that is 20x faster will be faced with the same problem as slower hardware.

A better algorithm on a slower computer will almost certainly have less runtime than a more naïve algorithm on a faster machine.

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

What are some design paradigms we have that can be used to develop faster algorithms?

A
  • Greedy algorithms
  • Divide and Conquer
  • Dynamic Programming
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

What is the dynamic programming paradigm?

A

Where we build a solution from the bottom up, using a table to store intermediate results

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

What is the definition of a pseudo polynomial time algorithm?

A

An algorithm is said to have pseudo polynomial runtime if its runtime is polynomial in the length of the input and the numbers appearing in the input

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

What is a pseudo polynomial (PP) time algorithm for the Knapsack problem?

A

An algorithm that uses a dynamic approach.

However this is only PP if the max weight and weights of the inputs are polynomial

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