Single linked list inversion

From , 5 Years ago, written in C, viewed 214 times.
URL https://pastebin.vip/view/2cad8fa4
  1. void reverse ( Linklist H )
  2. {
  3.         LNode *p;
  4.         p=H->next; /*p指向第一个数据结点*/
  5.         H->next=NULL; /*将原链表置为空表H*/
  6.         while ( p )
  7.         {
  8.                 q=p;
  9.                 p=p->next;
  10.                 q->next=H->next; /*将当前结点插到头结点的后面*/
  11.                 H->next=q;
  12.         }
  13. }

Reply to "Single linked list inversion"

Here you can reply to the paste above

captcha

https://burned.cc - Burn After Reading Website