In my class we have to answer a question:
Having this pseudocode:
XPTO(n) sum = 0 if even(n) for i=1 to n sum = sum + i else sum = 0
and knowing that even(n) have complexity ϴ(1), we can say the complexity of XPTO is ϴ(n)? Justify.
How do I justify this?