Hi, i have created a data structure {heap based}, capable of manipulating up to 10 million elements....I noticed that i can't go above this number because i have serious memory leaks....
The problem seems to be that i haven't written a destructor!{i a bit used to garbage collection!}
if i write a destructor of this type:
void clean( node *myNode )
{
if( myNode != NULL )
{
clean( myNode>left );
clean( myNode->right );
delete myNode;
}
}
then with so many elements, i will make the data structure even heavier...
so is there any other way to write the destructor??
thank you in advance for your time,
nicolas