how to take input in this ques
How to take input in this ques
im getting confused with true, false, -1
sir can u please tell one thing
i have written a code to find sum and its working on online compilers but giving segmentation fault on coding blocks submission.
please help me in that
please have a look at my solution once and tell me that why its giving segmentation fault on CB IDE not on other compilers and correct my mistake plz sir
@utkarsh.gupta0311 buddy im looking other doubts also actullay i was not well yesterday so could’nt take doubts and it has piled up…nevermind
The issue is in the takeinput function
replace that with this
void takeinput(BinaryNodeTree<int>* &root){
string left1,right1;
int d;
cin>>d;
root = new BinaryNodeTree<int>(d);
cin>>left1;
if(left1 == "true"){
takeinput(root->left);
}
cin>>right1;
if(right1 == "true"){
takeinput(root->right);
}
}
and now u can do a dry run to get the mistake, if not ping me
yes sir, i corrected it… sorry sir for disturbing
get well soon sir
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.