def ReverseList(pHead): # write code here # write code here if not pHead or not pHead.next: return pHead last = None while pHead: tmp = pHead.next pHead.next = last last = pHead pHead = tmp return last
标签:none not style span def blog eve bsp 反转链表
def ReverseList(pHead): # write code here # write code here if not pHead or not pHead.next: return pHead last = None while pHead: tmp = pHead.next pHead.next = last last = pHead pHead = tmp return last
标签:none not style span def blog eve bsp 反转链表
原文地址:https://www.cnblogs.com/gczr/p/8167982.html