Replacement Sum

repalceSum has return type of (int) but in main() . we are calling it has void return type . how is this true?

@Kameilirshad the return type is used for recursive calls as it used in updating value of each node. but we dont really need that value in the main function. so we dont store it anywhere. we could write int a = replacesum(root)
but we dont need that value, so we simply dont store it.

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.