Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Give a useful (big Theta) estimation for each of following function t(n). f. t(n) is the runtime of following function, public static int f1(int n){
Give a useful (big Theta) estimation for each of following function t(n).
f. t(n) is the runtime of following function, public static int f1(int n){ int mid = n/2; for (int i = mid; i >= 0; i--) System.out.println(i); for (int i = mid + 1; i 0; i /= 3){ System.out.println(i); return mid; h.t(n) is the runtime of following function, public static int f3(int n){ for (int i = n; i >= 0; i--){ for (int j = 0, j0; k /= 3) System.out.println(i * j + k); return n; i. t(n) is the runtime of following function, public static int f4(int[] a, int start, int end){ int ans = 0; if (start >= end) ans = a[start]; else { int mid = (start + end) / 2; int x = f(a, start, mid); int y = f4(a, mid+ 1, end); print(a, start, end); //print each element in a from start to end if (xStep 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