Question: An algorithm ALG consists of two tunable sub - algorithms ALGA and ALGB, which have to be executed serially ( i . e . ,

An algorithm ALG consists of two tunable sub-algorithms ALGA and ALGB, which have to be executed serially (i.e., one run of ALG involves first executing ALGA followed by ALGB). Moreover, given any function f(n), we can tune the two algorithms such that ALGA takes time O(f(n)) and ALGB takes time O(n2/f(n)). How should we choose f to minimize the overall runtime of ALG(i.e., to ensure the runtime of ALG is O(h(n)) for the smallest-growing function h)? How would your answer change if ALGA and ALGB could be executed in parallel, and we have to wait for both to finish?

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!