Identify and justify the asymptotic run time of this algorithm in terms of n. soRecursive(n) 1 if n < 3 2 return 1 3 els

Business, Finance, Economics, Accounting, Operations Management, Computer Science, Electrical Engineering, Mechanical Engineering, Civil Engineering, Chemical Engineering, Algebra, Precalculus, Statistics and Probabilty, Advanced Math, Physics, Chemistry, Biology, Nursing, Psychology, Certifications, Tests, Prep, and more.
Post Reply
answerhappygod
Site Admin
Posts: 899604
Joined: Mon Aug 02, 2021 8:13 am

Identify and justify the asymptotic run time of this algorithm in terms of n. soRecursive(n) 1 if n < 3 2 return 1 3 els

Post by answerhappygod »

Identify And Justify The Asymptotic Run Time Of This Algorithm In Terms Of N Sorecursive N 1 If N 3 2 Return 1 3 Els 1
Identify And Justify The Asymptotic Run Time Of This Algorithm In Terms Of N Sorecursive N 1 If N 3 2 Return 1 3 Els 1 (49.15 KiB) Viewed 39 times
Identify and justify the asymptotic run time of this algorithm in terms of n. soRecursive(n) 1 if n < 3 2 return 1 3 else 4 return n soRecursive(n/3) A. O(log3n) = O(lg n) since it takes O(log3n) calls to reach the base case and base of log is a constant difference B. O(n/3) = O(n) since the input is divided by 3 and we factor out constants in o O C. n * log3(n) = O(n Ig n) since n is multiplied by the recursive call, it takes O(log3n) calls to reach the base case, and base of log is a constant difference D. n * (n/3) = O(na) since n is multiplied by the recursive call and we factor out constants in o
Join a community of subject matter experts. Register for FREE to view solutions, replies, and use search function. Request answer by replying!
Post Reply