【leetcode❤python】206. Reverse Linked List
2024-08-26 11:19:02
# Definition for singly-linked list.
# class ListNode(object):
# def __init__(self, x):
# self.val = x
# self.next = None
class Solution(object):
def reverseList(self, head):
if(head==None):return None
if(head.next==None):return head
# pre=head
# p=head.next
# pre.next=None
# nxt=None
new_head=None
while head:
p=head
head=head.next
p.next=new_head
new_head=p
return new_head
最新文章
- Java:单例模式的七种写法
- SpringMVC学习(二)
- Linux第14周学习笔记
- TOMOYO Linux(undone)
- 从零开始学习jQuery (九) jQuery工具函数
- 关于git status
- Android APP开发需求文档范本
- 在域信任环境中使用 Team Foundation Server (TFS 2013)
- echarts分组插件echarts.group代码分享
- 译-Web Service剖析: XML, SOAP 和WSDL 用于独立于平台的数据交换
- Halcon的应用程序 打开后 弹出没有帮助文件错误提示
- 在macos上基于python2.7安装PyQt5
- qt deleterLater
- 四、View的工作原理
- 思路 一般创建展示类时候 例如page类 会在网页上新增多个对应字段的隐藏域 用于存储值
- Dapper Helper
- ICM Technex 2018 and Codeforces Round #463 (Div. 1 + Div. 2, combined) A
- nodejs--路径问题
- jquery写tab切换,三行代码搞定
- IIS中发布后出现Could not load file or assembly'System.Data.SQLite.dll' or one of its depedencies