反转链表 Posted on 2019-08-29 | In 剑指offer | | reads times 反转链表题目描述 输入一个链表,反转链表后,输出新链表的表头。 12345678910111213function ReverseList(pHead){ // write code here var pNode=null; var pNext=null; while(pHead!==null){ pNext=pHead.next; pHead.next=pNode; pNode=pHead; pHead=pNext; } return pNode;} Post author: GoldMiner Xun Post link: https://goldminerxun.github.io/2019/08/29/%E5%89%91%E6%8C%87offer%20JavaScript%E7%89%88%20(15)/ Copyright Notice: All articles in this blog are licensed under CC BY-NC-SA 3.0 unless stating additionally.