avatar
打板子原来是这样# 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.
avatar
T*e
2
-
avatar
d*w
3
这道题AOL的面试题,看了半天,不懂啥意思,有人会么?

of

【在 d********w 的大作中提到】
: 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:

avatar
d*e
4
现在新加坡的鞭刑还采用类似的做法。
avatar
p*2
5
你懂free store是什么意思吗?
avatar
B*1
6
哪里得aol啊,aol也入大牛你法眼了?

【在 d********w 的大作中提到】
: 这道题AOL的面试题,看了半天,不懂啥意思,有人会么?
:
: of

avatar
d*w
7
palo alto的,学术探讨一下嘛

【在 B*******1 的大作中提到】
: 哪里得aol啊,aol也入大牛你法眼了?
avatar
y*u
8

of
这个函数指针是free datum的么?
就是写个递归啊。。。

【在 d********w 的大作中提到】
: 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:

avatar
i*e
9
post-order traversal 吧,删除孩子节点,再删除 parent.
avatar
y*u
10
应该是无所谓啊
free掉parent节点之后,leftchild, rightchild的指针还是有效的

【在 i**********e 的大作中提到】
: post-order traversal 吧,删除孩子节点,再删除 parent.
相关阅读
logo
联系我们隐私协议©2024 redian.news
Redian新闻
Redian.news刊载任何文章,不代表同意其说法或描述,仅为提供更多信息,也不构成任何建议。文章信息的合法性及真实性由其作者负责,与Redian.news及其运营公司无关。欢迎投稿,如发现稿件侵权,或作者不愿在本网发表文章,请版权拥有者通知本网处理。