zoukankan      html  css  js  c++  java
  • 【剑指offer】Q16:翻转链表

    def reverse(head):
    	if head == None or head.next == None:
    		return head
    	psuhead = ListNode(-1)
    	while head:
    		nexthead = head.next
    		head.next = psuhead.next
    		psuhead.next = head
    		head = nexthead
    	head = psuhead.next
    	del psuhead
    	return head

查看全文
  • 相关阅读:
    2.22
    LG P7077 函数调用
    2020/10/30 模拟赛 序列
    2020/10/27 模拟赛 数列
    2020/10/23 模拟赛 chip
    2020/10/23 模拟赛 escape
    2020/10/23 模拟赛 center
    LOJ#6581. 「ICPC World Finals 2019」断头路探测者
    LG P1587 [NOI2016]循环之美
    LG P4156 [WC2016]论战捆竹竿
  • 原文地址:https://www.cnblogs.com/ldxsuanfa/p/10931019.html
  • Copyright © 2011-2022 走看看