通过代码:
/**
* Definition for singly-linked list.
* struct ListNode {
* int val;
* struct ListNode *next;
* };
*/
typedef struct ListNode LNode;
typedef struct ListNode *LNode_Pointer;
struct ListNode* reverseList(struct ListNode* head)
{
LNode_Pointer head_old_temp,tail,tail_prior;
head_old_temp=(LNode_Pointer)malloc(sizeof(LNode));
head_old_temp->next=head;
tail=head;
tail_prior=head_old_temp;
//我觉得又有必要申请一个新的头结点了。我觉得没有头结点真的挺麻烦的。在判断条件上。
LNode_Pointer head_temp,tail_temp;
head_temp=(LNode_Pointer)malloc(sizeof(LNode));
head_temp->next=NULL;
tail_temp=head_temp;
while(head_old_temp->next!=NULL)
{
tail_prior=head_old_temp;
tail=head_old_temp->next;
while(tail->next!=NULL)
{
tail_prior&