Home /
Expert Answers /
Computer Science /
determine-a-lower-bound-complexity-and-upper-bound-complexity-of-the-running-time-equation-of-this-pa247
(Solved): Determine a lower bound complexity and upper bound complexity of the running time equation of this ...
Determine a lower bound complexity and upper bound complexity of the running time equation of this problem below To do this you will have to specify the running time equation, T(n), of the program. def prob1(L) : s=0 for x in L: s+=s?=10+x for i in range(len (L)) : for j in range(i+1,len(L)) : s+=L[i]?L[j] return s Answer: Empty markdown cell, double-click or press enter to edit. Problem 2
Problem 3 Find the running time equation of this program below and its tight bound complexity (?). ## Input: A is a list of numbers, z is a number # def prob3 (A,z) : ??? output =[] for x in A:???? for y in A: return output ? \# \# Input: A is a list of numbers, z is a number \# def prob3(A,z) : output =[] for x in A : for y in A : if x+y=z : output. append (z) return output Answer: Empty markdown cell, double-click or press enter to edit. Problem 4 Find the running time equation of foo. def foo(L): if len(L)<=1 : return 1 s=? for x in L : s+=x remaining =L[? : len (L)//2] return s+ foo(remaining) Answer: