Sir why did we calculate the time in which a=1, shouldn’t it be when b=0 for recursion to end.
Time complexity of gcd
When any of the two numbers is 1, then the gcd is always 1. So we can return when we reach this condition.
1 Like
I hope I’ve cleared your doubt. I ask you to please rate your experience here
Your feedback is very important. It helps us improve our platform and hence provide you
the learning experience you deserve.
On the off chance, you still have some questions or not find the answers satisfactory, you may reopen
the doubt.
1 Like