funtion print (n)
if n>1:
print (n/2)
print (n/2)
for i = 1 to n
print_line("print me")
how many times the above function prints "print me"?
a) (lg n)
b) (n)
c) (n lg n)
d) (n^2 lg n)
Answers
Answered by
8
Answer:
b)(n)
Explanation:
because here you specify the condition in for loop that 1 to n.
it prints n times.
Answered by
2
Answer:(b) n
Explanation:
As the for loop says, it goes from 1 to n, hence it will print "n" times.
Similar questions