python剑指offer 合并两个排序的链表
2021-06-23 05:06
阅读:468
标签:规则 none class 需要 one 合并两个排序的链表 nod list merge
题目描述
输入两个单调递增的链表,输出两个链表合成后的链表,当然我们需要合成后的链表满足单调不减规则。
# -*- coding:utf-8 -*- # class ListNode: # def __init__(self, x): # self.val = x # self.next = None class Solution: # 返回合并后列表 def Merge(self, pHead1, pHead2): # write code here if pHead1 == None: return pHead2 elif pHead2 == None: return pHead1 pMergedHead = None if pHead1.val
python剑指offer 合并两个排序的链表
标签:规则 none class 需要 one 合并两个排序的链表 nod list merge
原文地址:https://www.cnblogs.com/tianqizhi/p/9674180.html
文章来自:搜素材网的编程语言模块,转载请注明文章出处。
文章标题:python剑指offer 合并两个排序的链表
文章链接:http://soscw.com/index.php/essay/97698.html
文章标题:python剑指offer 合并两个排序的链表
文章链接:http://soscw.com/index.php/essay/97698.html
评论
亲,登录后才可以留言!