When we call bfs function by passing root as a parameter, a tree is printed. Then we call replaceSum function by passing root as a parameter. and then again we call bfs function which produces the result as expected.
My question is why are not passing by address of the root node in replaceSum function?? How the values are changing in the root node as they are not passed by address.