void Tree_delete(struct Tree *pTree);
|
This subroutine deletes the tree pointed to by pTree. It frees all dynamically allocated memory for the tree pointed to by pTree.
Special care must be taken when a tree is deleted. The trick is to delete (Tree_delete) the subtrees of a node first, then delete (deallocate/free) a node. This means this subroutine can be done easily using recursion.