engineering recuitment Beltron Programmer Mock Test 2024 Algorithms Asymptotic Worst Case Time and Time Complexity Introduction
The following algorithm gets the number of digits in the factorial of a positive integer n. Which of the following is NOT a time complexity of this algorithm?
Algorithm getNoOfDigitsInFactorialOf(n)
{
nd = 0
for i = 1 to n
do
{
nd = nd + \(log_{10}\)(i)
}
nd = ceil(nd) + 1
return nd;
}
1
Ω (lg n)
2
O(n)
3
Θ(n)
4
Ω(n)