For each method determine the order of growth of the worst case running time as
ID: 3698025 • Letter: F
Question
For each method determine the order of growth of the worst case running time as N increases. Assume N>>1. Write your answer to the right of the method using "Big O" notation. You only need to write the order of growth; you do NOT need to explain how you got your answer. public static int 2(int() arr, int lo, int hi)//N = initial value of (hi-lo+1) of 1st activation of f2 i (lo = = hi) return lo; if(arr[hi] >= arr(lo]) return f2(arr, lo+l, hi); return f2(arr, lo, hi-1); > public static int f3(int N) { int i = N/5; while(i >0) i = i - 1; return N * N; > public static void f4(int N) { int a = 0; while(aExplanation / Answer
1.
O(logN)
2.
O(logN)
3.
O(N)
4.
O(N)
5.
O(N)
Related Questions
Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.