- 合并两个非递减的链表
# -*- 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
dummy = ListNode(0)
pHead = dummy
while pHead1 and pHead2: