Computer Science, asked by vanshika0206, 8 months ago

4. What is the worst case time complexity for the below loop?
Int foo (int n) {
If (n<=0) return -1;
Else {
Print n
N-n/2;
Return foo (n);
}
}
Pick one of the choices
A. 0(1)
B, O(log n)
C,O(n)
D.O(n^2)

Answers

Answered by dashingboyoh
6

Answer:

b answer of one choise bo (log n)

Answered by nishank2020
2

Answer:

B

Explanation:

Hope it helps

mark as brainliest

Similar questions