打板子原来是这样# Joke - 肚皮舞运动
d*w
1 楼
Given a binary tree made up out of the following structures:
typedef struct _tnode {
int key;
struct _tnode *left;
struct _tnode *right;
void *datum;
} TreeNode;
Write a C routine with the following prototype that returns all TreeNodes of
a tree to free
store:
void TreeFree(TreeNode *root,void (*datafreer)(void *));
where root is the root node of a tree, and datafreer is a pointer to a
function returning
void and taking a void * that will return the object pointed to by a
TreeNode.datum
pointer to free store.
typedef struct _tnode {
int key;
struct _tnode *left;
struct _tnode *right;
void *datum;
} TreeNode;
Write a C routine with the following prototype that returns all TreeNodes of
a tree to free
store:
void TreeFree(TreeNode *root,void (*datafreer)(void *));
where root is the root node of a tree, and datafreer is a pointer to a
function returning
void and taking a void * that will return the object pointed to by a
TreeNode.datum
pointer to free store.