Unit 2

Tractability

[19.1] Imagine you are trying to find the largest number in a small list of numbers using brute force. Describe how you would do this and what would the runtime be in that case?.

[19.2] What does it mean for an algorithm to be in the class P? Give a simple example of an operation or task that would be in class P.

[19.3] Explain what the NP class represents. Provide an example of a problem that is in the NP class.

[19.4] What makes a problem tractable? Give an example of a tractable problem.

[19.5] Describe what a heuristic is in the context of solving problems and provide an example of when one might be used.

[19.6] Which of the following complexity classes represents problems that can be solved in polynomial time?

A. O(n!)

B. O(2^n)

C. O(n^2)

D. O(n^n)

[19.7] The Traveling Salesperson Problem (TSP) can be efficiently solved in polynomial time.

[19.8] A problem is considered _______ if it can be solved in a time that increases polynomially with the size of the input.

[19.9] Match the following problems with their likely complexity class:

Problems:
Sorting a list of numbers.
Finding a specific path in a maze.
Checking if a large number is prime.

Complexity Classes:
A. P
B. NP

[19.10] Can all NP problems be verified in polynomial time?

[19.11] Which of the following is NOT a characteristic of NP-complete problems?

A. They can be solved in polynomial time.

B. They are at least as hard as the hardest problems in NP.

C. Their solution can be verified in polynomial time.

D. They can be used to solve all other NP problems.

[19.12] Every problem in NP is also in P.