Question: please help me with 19 and 20 because they are relative question 19. Suppose we implemented a brute-force algorithm to find the subset (of an
19. Suppose we implemented a brute-force algorithm to find the subset (of an input set S of integers) that has the highest sum of all subsets of S. In big-e notation, give the worst-case number of subsets that the algorithm would have to check. Additionally, in big-notation, give the best-case number of subsets that the algorithm would have to check. Justify your answers. 20. Suppose we implemented a brute-force algorithm to solve the stable matching problem (i.e. to find a stable matching). In big-e notation, give the worst-case number of perfect matchings that the algorithm would have to check. Justify your answer. Is such an algorithm efficient? Why or why not
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
