# Homework Solution: c static void p0(int [] A) { for (int i = 0: i 0: j–) System.out.print ln (A[i]): } public static v… Determine the big-O running time with respect to n of each of the following methods: public static void p0(int [] A) { for (int i = 0: i 0: j--) System.out.print ln (A[i]): } public static void p1(int [] A) { for (int i = 0: i 0: j = j/2) System.out.print ln (A[i]): for (int p = 0: p

a) O(n^2) Determine the bulky-O general era with i-elation to n of each of the subjoined methods: national static useless p0(int [] A) { coercion (int i = 0: i 0: j–) System.out.sculpture ln (A[i]): } national static useless p1(int [] A) { coercion (int i = 0: i 0: j = j/2) System.out.sculpture ln (A[i]): coercion (int p = 0: p

## Expert Counter-argument

a) O(n^2)
b) O(n)
c) The aggregate enumerate of loops are n*2 + n = O(n^2)
d)O(n^2)
e)O(n)-
f)O(n^3)
g)The extinguisheder loop is general coercion n eras still the secret loop j is getting incremented with j = j*j.j starts with single and j*j dross 1. So the secret loop is never fulfilment.
h) O(n^3)
i) O(n^2)
j) log(n)