Since the problem
is polynomial time reducible to
, so problem
can be solved using pseudo code of
as the subroutine by reducing the problem instance of
into problem instance of
and then performing algorithm of
over reduced problem instance of
. In this way we will get solution of
.
Time complexity :- Reducing problem instance of
into equivalent problem instance of
will take
time and then performing algorithm
which has complexity
will take total time complexity equal to
. Which is the upper bound of time complexity.
Please comment for any clarification.
Leni and n, be two problems such that Πι α,ely n, . Suppose that problem n,...
algorithm TRUE OR FALSE TRUE OR FALSE Optimal substructure applies to alloptimization problems. TRUE OR FALSE For the same problem, there might be different greedy algorithms each optimizes a different measure on its way to a solutions. TRUE OR FALSE Computing the nth Fibonacci number using dynamic programming with bottom-upiterations takes O(n) while it takes O(n2) to compute it using the top-down approach. TRUE OR FALSE Every computational problem on input size n can be...
Assume that a problem A cannot be solved in O(n2) time. However, we can transform A into a problem B in O(n2 log n) time, and then solve B, and finally transform the solution of B in O(n) time into a solution for A. Prove or Disprove: The above approach shows that B cannot be solved asymptotically less than O(n2) time.
True or False: If an NP-complete problem can be solved in cubic time, then all NP complete problems can be solved in cubic time. Cubic = O(n^3). Explain why true or false. I think the answer is False but I'm not exactly sure why that is so if someone could explain.
Suppose the following is a divide-and-conquer algorithm for some problem. "Make the input of size n into 3 subproblems of sizes n/2 , n/4 , n/8 , respectively with O(n) time; Recursively call on these subproblems; and then combine the results in O(n) time. The recursive call returns when the problems become of size 1 and the time in this case is constant." (a) Let T(n) denote the worst-case running time of this approach on the problem of size n....
3. (3 pts) Two well-known NP-complete problems are 3-SAT and TSP, the traveling salesman problem. The 2-SAT problem is a SAT variant in which each clause contains at most two literals. 2-SAT is known to have a polynomial-time algorithm. Is each of the following statements true or false? Justify your answer. a. 3-SAT sp TSP. b. If P NP, then 3-SAT Sp 2-SAT. C. If P NP, then no NP-complete problem can be solved in polynomial time.
Weird recursion tree analysis. Suppose we have an algorithm that on problems of size n, recursively solves two problems of size n/2, with a “local running time” bounded by t(n) for some function t(n). That is, the algorithm’s total running time T(n) satisfies the recurrence relation T(n) ≤ 2T(n/2) + t(n). For simplicity, assume that n is a power of 2. Prove the following using a recursion tree analysis (a) If t(n) = O(n log n), then T(n) = O(n(log...
Suppose you are given k sorted arrays of size n. Give an algorithm, that runs in O(nk log k)time, that merges them into a single list.
8. (12pts, Problems 16 and 17, page 461) Suppose that n measurements are to be taken under a treat- ment condition and another n measurements are to be taken independently under a control condition. It is assumed that the measurements follow normal distribution and the standard deviation is about 10 under both conditions. (a) (6pts) How large should n be so that the test of Ho : μχ μΥ against the one-sided alternative Hi : Ax > μΥ has a...
the two problems are related. Please explain your
answer in full detail
Problem 1: On input a Binary Search Tree T show how to output an array that contains all the elements in T in sorted order. What's the running time of your algorithm? Does it perform any comparisons? Problem 2: Your classmate claims that they have an algorithm that on input n elements, constructs a Binary Search Tree T with those n elements using only O(n) comparisons. Can you...
IOs, mltipncation, division) counts as one step of the algorithm. sheet, the ith problem is worth pi points. The problems must be solved in the given order, but it is possible to skip (not to solve) some of them. Furthermore, if a student solves the ith problem, then she/he gets so exhausted that she/he must skip the next fi problems (of course she/he may skip O(n) running time dynamic programming algorithm that determines the maximum possible points that are numbers...