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

查看全文
  • 相关阅读:
    实验四 决策树算法及应用
    实验三 朴素贝叶斯算法及应用
    实验二 K-近邻算法及应用
    实验一 感知器及其应用
    园区网核心、防火墙、边界出口冗余实验配置
    PNETLab模拟器部署及使用配置
    基于RPS开发模式的可视化设计解决方案
    Python学习手册《Learning Python》
    【转】Windows 64bit下Python环境配置与集成IDE PyCharm
    时间复杂度完美例子---数组最大子序列和
  • 原文地址:https://www.cnblogs.com/ldxsuanfa/p/10931019.html
  • Copyright © 2011-2022 走看看