//链表逆转
struct node
{
int element;
struct node* next;
};
struct node* revrese(struct node* oldhead)
{
struct node* newhead = NULL;
struct node* temp;
while(oldhead){
temp=oldhead->next;
oldhead->next=newhead;
newhead=oldhead;
oldhead=temp;
}
return newhead;
};
单链表逆转
最新推荐文章于 2021-09-14 15:37:56 发布