Recursive Method Time Complexity
Given the recursive method ‘recursiveExponent’, what is its time complexity in Big-O notation?
public class ExponentialRecursion {
public void recursiveExponent(int n) {
if(n <= 1) return;
recursiveExponent(n/2);
recursiveExponent(n/2);
}
}
A
O(n)
B
O(n^2)
C
O(log n)
D
O(n log n)
Question Leaderboard
Not enough data yet to show leaderboard.
APFIVE