Grokking Algorithm Complexity and Big-O
Ask Author
Back to course home

0% completed

Vote For New Content
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);
}
O(1)
O(n)
O(n<sup>2</sup>)
O(log n)

.....

.....

.....

Like the course? Get enrolled and start learning!