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)

Database System Concepts
7th Edition
ISBN:9780078022159
Author:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Chapter1: Introduction
Section: Chapter Questions
Problem 1PE
icon
Related questions
Question

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 []

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)
Transcribed Image Text: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)
AI-Generated Solution
AI-generated content may present inaccurate or offensive content that does not represent bartleby’s views.
steps

Unlock instant AI solutions

Tap the button
to generate a solution

Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
Database System Concepts
Database System Concepts
Computer Science
ISBN:
9780078022159
Author:
Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:
McGraw-Hill Education
Starting Out with Python (4th Edition)
Starting Out with Python (4th Edition)
Computer Science
ISBN:
9780134444321
Author:
Tony Gaddis
Publisher:
PEARSON
Digital Fundamentals (11th Edition)
Digital Fundamentals (11th Edition)
Computer Science
ISBN:
9780132737968
Author:
Thomas L. Floyd
Publisher:
PEARSON
C How to Program (8th Edition)
C How to Program (8th Edition)
Computer Science
ISBN:
9780133976892
Author:
Paul J. Deitel, Harvey Deitel
Publisher:
PEARSON
Database Systems: Design, Implementation, & Manag…
Database Systems: Design, Implementation, & Manag…
Computer Science
ISBN:
9781337627900
Author:
Carlos Coronel, Steven Morris
Publisher:
Cengage Learning
Programmable Logic Controllers
Programmable Logic Controllers
Computer Science
ISBN:
9780073373843
Author:
Frank D. Petruzella
Publisher:
McGraw-Hill Education