in the code line:
if ( data < root->left ){
root->left = deleteinBST ( root->left,data );
return root;
}
why are we returning root, doesn’t it get automatically updated since it’s an address.
in the code line:
if ( data < root->left ){
root->left = deleteinBST ( root->left,data );
return root;
}
why are we returning root, doesn’t it get automatically updated since it’s an address.
are maanlo root ke left vala hi delete ho raha hai so tree tut gaya no toh left pointer ko kuch toh return karna padhega na aise socho