Extended euclidean

sir, how the current x (cx) and current y (cy) are updating in code of extended euclidean. please elaborate how the recursive function working here

@dolargautm Take a look at this explanation before arriving at the algorithm https://cp-algorithms.com/algebra/extended-euclid-algorithm.html
Your cx and cy are getting updated according to this algorithm because of which values of cx and cy are reducing
thus eventually returning the gcd.
I would suggest you to print the value of cx and cy at every call and see how they change.

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.