Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Calculate T(n), making sure not to discard constants or low-order terms yet (you may or may not count the counting variable in a for loop)
Calculate T(n), making sure not to discard constants or low-order terms yet (you may or may not count the counting variable in a for loop)
Give what you think is the Big-O performance for the function
Prove that your proposed Big-O for the function is correct (make sure to show your work; do not just provide values for c and n0)
def fun2(n): x = 0 for i in range(n): for j in range(n): for k in range (1, n): x = x + 1 return x def fun3 (n): x = 0 i = 2 * n while i >= 1: x = x - i i = i - 1 return X
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