getting segmentation fault
Sum at k tree recursion
hi @guptashubham210a input for k is given in the end, but you are taking it in the starting itself. Do look at the input format carefully!
@getting wrong output now
@Ishitagambhir
why this call wasn’t working?
if (k == 0)
{
return root->data;
}
return (root->left, k - 1) + sumatk(root->right, k - 1);
@guptashubham210a the function name is missing.
It should be sumatk(root->left, k-1)
instead its just (root->left, k-1)

