0

Can somebody help me with error Its a small error ...idk please run in ide's

Binary tree successor and predecessor https://code.sololearn.com/cW70J8mm039z/?ref=app https://code.sololearn.com/cW70J8mm039z/?ref=app

28th Oct 2020, 8:30 PM
Sooraj m
Sooraj m - avatar
6 odpowiedzi
+ 1
At first glance, the function declaration for findPreSuc() does not look right. I think the ampersands (&) on the parameters should not be there. Change this: void findPreSuc( struct Node* root, struct Node* &pre, struct Node* &suc, int key) To this: void findPreSuc( struct Node* root, struct Node* pre, struct Node* suc, int key) Remove #import <conio.h>, because you are not using any of the functions defined therein. Then you can also have it build and run here on SoloLearn.
28th Oct 2020, 9:49 PM
Brian
Brian - avatar
+ 1
Tnx for the help bro
30th Oct 2020, 12:22 PM
Sooraj m
Sooraj m - avatar
0
K tnx I will try
30th Oct 2020, 10:59 AM
Sooraj m
Sooraj m - avatar
0
Tnx any way but the output doesnt seem enriching have to try more....
30th Oct 2020, 11:02 AM
Sooraj m
Sooraj m - avatar
0
Sooraj m, now I looked at it in depth and I see the need for more pointer syntax corrections. Here are the line numbers and corrected code. 14 void findPreSuc( struct Node* root, struct Node** pre, struct Node** suc, int key) 26 *pre = tmp ; 35 *suc = tmp ; 43 *suc = root ; 48 *pre = root ; 97 findPreSuc(root, &pre, &suc, key); Try these changes. I think you will be very pleased with the outcome!
30th Oct 2020, 12:13 PM
Brian
Brian - avatar
0
You are welcome!
30th Oct 2020, 12:27 PM
Brian
Brian - avatar