Exemplo n.º 1
0
/**
 *
 *  Function used to delete a tree. Do not call directly. 
 *
 */
static void deleteTreeRecursive(Node *x/*, int *sizeDb*/){
	if (x->right != NIL) deleteTreeRecursive(x->right/*, sizeDb*/);
	if (x->left != NIL) deleteTreeRecursive(x->left/*, sizeDb*/);

	freeRBData(x->data/*, sizeDb*/);
	free(x);
}
Exemplo n.º 2
0
/**
 *
 *  Function used to delete a tree. Do not call directly.
 *
 */
static void deleteTreeRecursive(Node *x, int *sizeDb) {
    if (x->right != NIL) deleteTreeRecursive(x->right, sizeDb);
    if (x->left != NIL) deleteTreeRecursive(x->left, sizeDb);

    freeRBData(x->data, sizeDb);
    free(x);
}
Exemplo n.º 3
0
static void deleteTreeRecursive(Node *x)
{
  if (x->right != NIL)
    deleteTreeRecursive(x->right);

  if (x->left != NIL)
    deleteTreeRecursive(x->left);

  freeRBData(x->data);
  free(x);
}
Exemplo n.º 4
0
void deleteTree(RBTree *tree)
{
  if (tree->root != NIL)
    deleteTreeRecursive(tree->root);
}
Exemplo n.º 5
0
/**
 *
 *  Delete a tree. All the nodes and all the data pointed to by
 *  the tree is deleted. 
 *
 */
void deleteTree(RBTree *tree){
	//int *ptr = &(tree->sizeDb);
	if (tree->root != NIL) deleteTreeRecursive(tree->root/*, ptr*/);
}