You are viewing a single comment's thread. Return to all comments →
Use "nullptr" instead of "null". Why don't you use pointers?
Node node=new Node();
This is dynamic memory allocation. You should later delete allocated memory (like this => delete node; if you don't want memory leak.
delete node;
Seems like cookies are disabled on this browser, please enable them to open this website
Binary Search Tree : Insertion
You are viewing a single comment's thread. Return to all comments →
Use "nullptr" instead of "null". Why don't you use pointers?
Node node=new Node();
This is dynamic memory allocation. You should later delete allocated memory (like this =>
delete node;
if you don't want memory leak.