Plz explain me the flow of control

Plz explain me the flow of control of the recursion case,ie,how the recursion case is getting executed.
plz exlain clearly.

This is how backtracking is happening.
Code starts with i=0; suppose string is abc (lets call this function state as call 1)
swap a with a , call permute and pass 1
we are in new call (call 2)
now swap b with b, call permute and pass 2
we are in new call (call 3)
now swap c with c, call permute and pass 2
we are in new call (call 4)
now here print string (our base case)
function ends, we return to previous call
we are in call 3
again swap c with c and return
we are in call 2
swap back b with b
swap b with c
call permute with i=2
(now again same set of steps will follow and we will come back to this call)
swap back b with c
call ends we return to call 1
the whole process repeats.

When the function ends…why we return to the previous call

Whenever we call a function, after the called function has executed we return back to calling function, and execution starts from the point where it was left before making the call.

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.