Can you tell me where I am making mistake?

@raj.verma5454 add a braces in line 65 instead of 69.
also to create the sum u are only adding the right children to it . so ur 20 remains 20 and 30 is 30+40=70 which is wrong .correct that