Python
Big-O Coding
will give high rating if answers are correct ty!
Extracted text: Big-O Coding Exercise: Given: Consider the function below written in Python3: def foo(a, b=[1]): if a <= 1:="" return="" b="" b_new="[b[i]" +="" b[i+1]="" for="" i="" in="" range(len(b)-1)]="" return="" foo(a-1,="" [1]="" +="" b_new="" +="" [1])="" question:="" what="" is="" the="" worst-case="" time="" complexity="" of="" foo(a,="" b)="" assuming="" initial="" b="(Follow/use" the="" notes="" above)="" [1]?="" answer:="" notes="" when="" answering:="" note="" that="" when="" complexities="" or="" expressions="" are="" asked:="" •="" answer="" without="" the="" big-o.="" assume="" a,="" x,="" and="" y="" are="" very="" large.="" use="" 'log()'="" to="" add="" the="" logarithmic="" function="" (e.g.="" n="" log(n)="" is="" written="" as="" n*="" log(n="" )).="" use="" "(e)'="" to="" create="" exponents="" (e.g.="" 2"="" is="" written="" as="" 2^(n="" )).="" •="" use="" 'sqrt()'="" to="" create="" square="" roots="" (e.g.="" vn="" is="" written="" as="" sqrt(n="" )).="" •="" remember="" that="" log,="" a="log" a/="" log="">=>
Already registered? Login
Not Account? Sign up
Enter your email address to reset your password
Back to Login? Click here