Anyone to help how we arrive to '2' as the output
8/11/2020 6:19:40 AM
= 1 + sum(3,1)
= 1 + (1 + sum(2,0)) # now it will hit the base case
= 1 + (1 + 0)
Did you understand that this is an implenentation of the function min(a, b) for a, b > 0?
if not it might be a good challenge to.
The function is calling itself and running like a loop untill the condition is meet
Thank you all for your answers, Arsenic you made it crystal clear.
Thank you Oma Falk i understand now
Oma Falk That sounds better!
Alexander Thiem thanks for checking.
Oma Falk an implementation for difference? No appearently not
Input:4,1 does not result in 3......
Alexander Thiem typo
it was min
Learn Playing. Play Learning
Send us a message