Question
USE PYTHON3; DO NOT IMPORT ANY PACKAGES Judge if the following equations about complexity hold. Write your answer (True or False) in the complexity_tf() function,
USE PYTHON3; DO NOT IMPORT ANY PACKAGES
Judge if the following equations about complexity hold. Write your answer (True or False) in the complexity_tf() function, which returns your answers as a list of 10 boolean values. In this list, write your answer to the first equation at index 0, second equation at index 1, etc. ( Note for students who have this question: I use big-O as a tight bound).
Equations:
def complexity_tf():
"""
>>> answers = complexity_tf()
>>> isinstance(answers, list)
True
>>> len(answers)
10
>>> all([isinstance(ans, bool) for ans in answers])
True
"""
# YOUR CODE GOES HERE #
return [...]
Update: Sorry about that, didn't realize it didn't copy. I also fixed a typo, I meant to say don't import any packages, not doctests. Thank you
Equations: 1) 0(10086 x ) =0(n) 2) O(20212 + 22021) = 0(2") 3) O(4n) + (2n) = O(n) 4) O(3n log n + 100n) = O(n log n) 5) O(100n log n + 3n) = O(n log n) 6) O(4" + 3") = O(4") 7) O(606118) + O(Vm) = O(n) 8) On! + n)=0(") 9) O(log, n +logn+log, n) = O(log; n) O(n + 2n) +2(n+) =n) O(n2) 10)Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started