Examples: 1. 3n O(n) True 2. logn 0(1) False Note: The doctests for this question are sanity checks, only indicating that you have put answers in the correct form. Equations: 1. n! + 2 = 0 (3") 2. log.n" + 15n= O(nlog(n)) 3. 10n992 + n = O(n) 4. logn log₁n = O(log₂n) 12 3 logon n 5. 6 * log(n) + = O(n) n log₂√n 6. log √√n = 0(1) 7. == 0(1) n(2n+1)+ 3n+2 n 8. log(logn) + log₂n = O(logn) n 9. 10 + 912 10. = 0(n") 1+2+3+..+ (n/8 – 1) + n/8 = 0(n)
Complexity is an important concept in coding as we want our code to be as efficient as possible. 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.
def complexity_tf():
"""
Write your answers to time complexity True/False questions in this
function. No new doctests required.
>>> answers = complexity_tf()
>>> isinstance(answers, list)
True
>>> len(answers)
10
>>> all([isinstance(ans, bool) for ans in answers])
True
"""
# REPLACE ... WITH YOUR ANSWERS (True/False) #
return []
Unlock instant AI solutions
Tap the button
to generate a solution