Delete the leaf node in BST

I am trying to dry me wrong please correct me

instead delete operator if we assign root== NULL or assign another address is not going to impact anything Right?? So what approach i should follow?

https://ide.codingblocks.com/s/263675 this ways

this is not correct as node is not acturally deleted
this is known as memory leakage

correct way

if(root->left == NULL && root->right == NULL) {
			delete root;
			return NULL;
		}

@asaurabh_26 got it thanks

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.