I have the following function which computes the sum of all numbers from a to b. I'd like to know how to find its time complexity (without using the master theorem). I'd love getting an intuitive explanation and how to approach such problem.
def sum_func(a, b):
if a == b:
return a
mid = (a+b) // 2
return sum_func(a, mid) + sum_func(mid+1, b)