标签:lin return pre asc col next span sel lis
1 function reverseLinkedList(head) { 2
3 if (head === null || head.next === null) { 4 return head; 5 } 6 let newHead = null
7 while (head) { 8 let next = head.next 9 head.next = newHead 10 newHead = head 11 head = next 12 } 13 return newHead 14 }
标签:lin return pre asc col next span sel lis
原文地址:https://www.cnblogs.com/flamestudio/p/12306290.html