What is a brute-force algorithm?
- AOne that always uses recursion
- BOne that runs on many processors
- COne that tries all possible candidate solutions
- DOne that guesses an answer at random
What is a brute-force algorithm?
What does the worst-case running time of an algorithm describe?
What is the Big O of 3n² + 5n + 2?
What is the time complexity of: for i = 1 to n: (j = 1; while j < n: j = j × 2)?
A function runs one loop of n iterations and then, separately, another loop of n iterations. What is its time complexity?
How many levels does the recursion of merge sort have for an array of n elements?
For which knapsack variant does the greedy rule "take items in order of value per weight" always give an optimal answer?
Shortest simple paths can be found in polynomial time. What is known about finding the longest simple path between two vertices in a general graph?
Full step-by-step solutions: practise this topic on examproblems.com.