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

查看全文
  • 相关阅读:
    python 匿名函数lambda()
    python列表推导式
    python数组的基本操作一(添加,扩展,插入)
    Python的数字类型
    Python初识以及Windows安装教程
    字典简单使用
    two sum(LeetCode)
    python读写文件
    C++ volatile关键字(转)
    实验一
  • 原文地址:https://www.cnblogs.com/ldxsuanfa/p/10931019.html
  • Copyright © 2011-2022 走看看