def printer (n): if (n <= 0): return "please enter a number greater than 0" else: for i in xrange (0,n) print i what's the run time of this algo? | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
0

def printer (n): if (n <= 0): return "please enter a number greater than 0" else: for i in xrange (0,n) print i what's the run time of this algo?

Algo runtime

6th Sep 2016, 6:59 AM
brian
2 Answers
+ 1
O(n)
6th Sep 2016, 7:03 AM
Amanuel Nega
Amanuel Nega - avatar
0
thank you Amanuel, could you kindly explain it for me, I'm having trouble understanding the runtime for algo's
6th Sep 2016, 7:05 AM
brian