An algorithm A executes some instructions to solve a problem of size n, the total number of instruction is Θ (n3). An algorithm B executes half the instructions of A to solve the same problem of size n. What is the Big Theta of B (justify your answer) ?
number of instructions of B = number of instructions of A / 2 which is n^3/2 we can ignore the constant factor of 1/2 so, complexity of algorithm B is also Θ(n^3) Answer: Θ(n3)
An algorithm A executes some instructions to solve a problem of size n, the total number...
Algorithms A and B perform the same task. On input of size n, algorithm A executes 0.003n2 instructions, and algorithm B executes 243n instructions. Find the approximate value of n above which algorithm B is more efficient. (You may use a calculator or spreadsheet.)
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....
Suppose that an algorithm takes 30 seconds for an input of 224 elements (with some particular, but unspecified speed in instructions per second). Estimate how long the same algorithm, running on the same hardware, would take if the input contained 230 elements, and that the algorithm's complexity function is: Big theta not Big O a) Big theta(N) b) Big theta (log N) c) Big theta (N log N) d) Big theta(N^2) Assume that the low-order terms of the complexity functions...
(d) Consider an algorithm A, whose runtime is dependent on some "size" variable n of the input. Explain the difference between the two statements below, and give an explicit example of an algorithm for which one statement is true but the other is false. 1. The worst case time complexity of A is n2. 2. A is O(n). (e) Give an example of an algorithm (with a clear input type) which has a Big-Oh (0) and Big-Omega (12) bound on...
Problem 2.15. A certain algorithm takes 10-4 2n seconds to solve an instance of size n. Show that in a year it could just solve an instance of size 38. What size of instance could be solved in a year on a machine one hundred times as fast? A second algorithm takes 10-2 x n3 seconds to solve an instance of size n. What size instance can it solve in a year? What size instance could be solved in a...
A divide-and-conquer algorithm solves a problem by dividing the input (of size n>1, T(1) =0) into two inputs half as big using n/2-1 steps. The algorithm does n steps to combine the solutions to get a solution for the original input. Write a recurrence equation for the algorithm and solve it.
A divide-and-conquer algorithm solves a problem by dividing the input (of size n>1, T(1) =0) into two inputs half as big using n/2-1 steps. The algorithm does n steps to combine the solutions to get a solution for the original input. Write a recurrence equation for the algorithm and solve it.
if possible solve part d in detail. a) fi(n) n2+ 45 n log n b) f:(n)-1o+ n3 +856 c) f3(n) 16 vn log n 2. Use the functions in part 1 a) Isfi(n) in O(f(n)), Ω(fg(n)), or Θ((6(n))? b) Isfi(n) in O(f(n)), Ω(f,(n)), or Θ((fs(n))? c) Ísf3(n) in O(f(n)), Ω(f(n)), or Θ(f(n))? d) Under what condition, if any, would the "less efficient" algorithm execute more quickly than the "more efficient" algorithm in question c? Explain Give explanations for your answers...
Problem 2. (5 pts.) Algorithms A and B perform the same task. On input of size n, algorithm A executes 10 n 2 steps, and algorithm B executes 100,000 steps. Find the value of n above which algorithm B is more efficient. Show your work.
You are given an algorithm that uses T(n) a n2b.3" basic operations to solve a problem of size n, where a and b are some real non-negative constants. Suppose that your machine can perform 400,000,000 basic operations per second (a) If a = b = 1, how long does it take for your algorithm to solve problems of size n = 10, 20, 50. For each size of n, include the time in seconds and also using a more appropriate...