首页 > 代码库 > 链表反转

链表反转

链表反转简单实现

Node* rever(Node* Head){       if(Head == NULL || Head->next == NULL)        return Head;    Node* cur, next, next_next;    cur = Head;     next = cur->next;    while(cur->next != NULL){        next_next = next->next;        next->next = cur;        cur = next;        next = next_next;    }    Head->next = NULL;    return cur;}

  

链表反转