You should remember that your placement of recursive call to function is such that after the recursion is over, the subsequent cout statements will also get executed:
keskiverto its the same thing and abhishekm if subseqent cout is executed shouldnt it output turn 3 only once and why does in my guess of output in the last part (turn 2:
turn 1:
2->1) only turn 2 is there and is not inverted this time