For each algorithm below, indicate the running time using the simplest and most
ID: 3668727 • Letter: F
Question
For each algorithm below, indicate the running time using the simplest and most accurate big-Oh notation, as a function of n. Assume that all arithmetic operations can be done in constant time. The first algorithm is an example. No justifications are required.
For each of the algorithms below, indicate the running time using the simplest and most accurate big-Oh notation. Assume that all arithmetic operations can be done in constant time. The first algorithm is an example. No justifications are needed. Running time in big-Oh no- tation Algorithm Algorithm Example(n) for i 1 to n do Algorithm algol(n) while i 1) do Algorithm algo4(n) for i 1 to 1000 for j 1 to i k(k + i-j) * (2 + i + j)Explanation / Answer
2) O(n)
3) O(n^2)
4) O(logn)
5) O(1)