Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Q1. Algorithms Course Question 1.) (12 pts) Determine the time complexities of the following using Big-O notation and select the appropriate answer. A.) O(n) B.)
Q1. Algorithms Course
Question 1.) (12 pts) Determine the time complexities of the following using Big-O notation and select the appropriate answer. A.) O(n) B.) O(Ign) C.) O(n) D.) 0(n) E.) O(n-lgn) F.) 0(2) G.) O(3") H) 0n!) I.) O(lgan) J.) O(nlgn) a) fl (n) { if n == 1 return 1; else for il ton print i return flin-3) + 1 (n-3); b.) 12 (n) { if n == 1 return 1; else for i=1 to n print i return f2 (n/2) + f2 (n/2); } f3 (n) { if ns1 return 1; else for 1=1 to n print i; return 2 * 13 (n-2); d.) 54 (n) { if noul return 1; else for i= 1 ton print i; return 2 * 14 (n/2); }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