The original Linklist is as diagram shown:
Data Structure--Reverse LinkList
 the codes are following
   
 node *reverse(node *head)
  {
    node *p1,*p2,*p3;
    if(head==NULL || head->next=-NULL)
    return head;
    //p1-->previous pointer
    //p2-->current pointer
    //p3-->next pointer
    p1=head;
    p2=p1->next;
    while(p2)
    {
    p3=p2->next;
    p2->next=p1;
    p1=p2;
    p2=p3;
    }

    head->next=NULL;
    head=p1;
    return head;
  }

相关文章:

  • 2021-09-04
  • 2021-11-27
  • 2022-12-23
  • 2022-12-23
  • 2021-05-14
  • 2021-09-17
  • 2021-08-20
  • 2021-09-03
猜你喜欢
  • 2021-08-10
  • 2021-05-25
  • 2021-07-27
  • 2021-04-16
  • 2021-07-04
  • 2021-05-16
相关资源
相似解决方案