Exemple #1
0
void destroyAux(struct Node* node)
{
        if (node == NULL)
                return;
        destroyAux(node->next);
        //printf("Freeing node with the value of %d\n", node->val);
        free(node);
}
Exemple #2
0
 ~Tree() {
     destroyAux(root);
 }
Exemple #3
0
 void destroyAux(TreeNode * parent) {
     if (!parent) { return; }
     destroyAux(parent->left);
     destroyAux(parent->right);
     delete parent;
 }
Exemple #4
0
 void destroyAux(TreeNode * n) {
     if (!n) { return; }
     destroyAux(n->left);
     destroyAux(n->right);
     delete n;
 }
Exemple #5
0
void destroy(List* list)
{
        destroyAux(list->head);
}