给定如下C程序:
空白处填入以下哪项能实现该函数的功能?
1
2
3
4
5
6
7
8
9
10
11
12
13
|
typedef
struct
node_s{
int
item;
struct
node_s* next;
}node_t;
void
reverse_list(node_t* head)
{
node_t* n=head;
head=NULL;
while
(n){
_________
}
return
head;
}
|
- node_t* m=head; head=n; head->next=m; n=n->next;
- node_t* m=n; n=n->next; m->next=head; head=m;
- node_t* m=n->next; n->next=head; n=m; head=n;
- head=n->next; head->next=n; n=n->next;
- 答案B