struct ListNode{ int val; struct ListNode *next; }; struct ListNode* reverse(struct ListNode* head) { struct ListNode* new_head = NULL, *tmpNode; while(head) { tmpNode = head->next; head->next = new_head; new_head = head; head = tmpNode; } return new_head; }
点赞 1

相关推荐

10-31 20:07
门头沟学院 Java
点赞 评论 收藏
分享
牛客网
牛客网在线编程
牛客网题解
牛客企业服务