Question

In: Computer Science

Question 15: Use the Master theorem to find the asymptotic complexity of the running time function...

Question 15: Use the Master theorem to find the asymptotic complexity of the running time function T(n) of the program in problem 14.

--- Problem 14 ---

def prob14(L):
if len(L) <= 1:
return 0
output = 0
for x in L:
for y in L:
output += x*y
for x in L:
output += x
left = L[ 0 : len(L)//2 ]
right = L[ len(L)//2 : len(L) ]
return output + prob15(left) + prob15(right)

***Big-O, Omega, Theta complexity of functions, Running time equations of iterative functions & recursive functions,  Substitution method & Master theorem

Please answer within these topics.***

Solutions

Expert Solution

The algorithm you given in question hasn't proper Indentation, so from my intuition I have taken the algorithm as in my solution image below. So match it with your question and let me know in comment section, if any changes required. If you liked the solution, then please LIKE the solution for my motivation.

Still any doubt? do ask in comment section


Related Solutions

***Only Complete the Bolded Part of the Question*** Complete the asymptotic time complexity using Master theorem,...
***Only Complete the Bolded Part of the Question*** Complete the asymptotic time complexity using Master theorem, then use the "Elimination Method" to validate your solution. Clue for Last question: you need to use the elimination method to obtain analytical TC first. 1. T(n)= 4T(n/3) + n lg n 2. T(n)= 3T(n/3) + n / lg n
***Only Complete the Bolded Part of the Question*** Complete the asymptotic time complexity using Master theorem,...
***Only Complete the Bolded Part of the Question*** Complete the asymptotic time complexity using Master theorem, then use the "Elimination Method" to validate your solution. 1. T(n)= T(7n/10) + n
Give the asymptotic (“big-Oh”) running time complexity of the following algorithm, show all the work you...
Give the asymptotic (“big-Oh”) running time complexity of the following algorithm, show all the work you have done. Algorithm: ArrayMangle(A[ ], int n) Input: an array A, an integer n x = 0; for (i=0; i<=n-1; i++) { for (j=i; j<=n-1; j++) { x = x + A[j]; } for (k=0; k<= n-1; k++) { for (j=0; j< =n-1; j++) { x = x + A[j]*A[k]; } } }
Hi, I am having trouble with trying to calculate asymptotic time complexity for each of these...
Hi, I am having trouble with trying to calculate asymptotic time complexity for each of these functions. A step by step tutorial would be great. This is done in Python. Please not only the answer, but how you calculated it as well. Here is the code #Q2 # to denote ayymptotic time complexity use the following notation # O(l) O(m) O(a) O(b) # e.g. traversing through l = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10] is O(l)...
Problem 3: (a) Implement a sublinear running time complexity recursive function in Java public static long...
Problem 3: (a) Implement a sublinear running time complexity recursive function in Java public static long exponentiation(long x, int n) to calculate x^n. Note: In your function you can use only the basic arithmetic operators (+, -, *, %, and /). (b) What is the running time complexity of your function? Justify. (c) Give a number of multiplications used by your function to calculate x^63. Important Notes: • For the item (a): o You must add the main method in...
Question 2: Calculate the time complexity function T(n) and express it in terms of big-Oh for...
Question 2: Calculate the time complexity function T(n) and express it in terms of big-Oh for the following code: Part a       (hint: make use of sum of geometric progression): for (int i=1; i <= n ; i = i*2) {           for ( j = 1 ; j <= i ; j ++)             {                       cout<<”*”;             } } Part b      (hint: make use of sum of square of a number sequence): for (int i=1; i <= n ; i...
Find Aut(Z 15). Use the Fundamental Theorem of Abelian Groups to express this group as an...
Find Aut(Z 15). Use the Fundamental Theorem of Abelian Groups to express this group as an external direct product of cyclic groups of prime power order. (Thank you. If any theorems. corollaries, definitions, etc. are related, I'd appreciate the extra knowledge. If you don't have time, I understand and thanks, anyway.
What is time Complexity each of the following function? 1- void function(int n) {             for (int...
What is time Complexity each of the following function? 1- void function(int n) {             for (int i=n/2; i<=n; i++)                           for (int j=1; j<=n/2; j++)                                     for (int k=1; k<=n; k = k * 2)                                                 print ”Hello”; } 2- void function(int n) {             for (int i=n/2; i<=n; i++)                           for (int j=1; j<=n; j = 2 * j)                                     for (int k=1; k<=n; k = k * 2)                                                 print ”Hello”; } 3- void function(int n) {             for (int i=1; i<=n; i++)                           for (int j=1;...
use the Rational Zeros Theorem to find all the real zeros of each polynomial function given...
use the Rational Zeros Theorem to find all the real zeros of each polynomial function given below: f(X)=3X^3 + 6X^2 -15X - 30 f(X) = 2X^4 - X^3 - 5X^2 + 2X + 2
Find all zeros of the polynomial function. Use the Rational Zero​ Theorem, Descartes's Rule of​ Signs,...
Find all zeros of the polynomial function. Use the Rational Zero​ Theorem, Descartes's Rule of​ Signs, and possibly the graph of the polynomial function shown by a graphing utility as an aid in obtaining the first zero or the first root. f(x)=2x4-17x3+13x2+53x+21 The zeros of the function are?
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT