Archived
n(n+1) over 2
An old note — I haven't updated it since I wrote it.
Write a python program with a time complexity of f(n) = (n*(n+1))/2 and class O(n^2)
1for i in range(n):
2 for j in range(0, i):
3 print(i)
Archived
Write a python program with a time complexity of f(n) = (n*(n+1))/2 and class O(n^2)
1for i in range(n):
2 for j in range(0, i):
3 print(i)