Back to course home
0% completed
Quiz
Question 1
What is the time complexity of the following recursive function?
public void printNumbers(int n) {
if (n == 0) return;
System.out.println(n);
printNumbers(n - 1);
}
A
O(1)
B
O(n)
C
O(n2)
D
O(log n)
.....
.....
.....
Like the course? Get enrolled and start learning!
Table of Contents
Contents are not accessible
Contents are not accessible
Contents are not accessible
Contents are not accessible
Contents are not accessible