面试题35:复杂链表的复制

# -*- coding:utf-8 -*-
# class RandomListNode:
# def __init__(self, x):
# self.label = x
# self.next = None
# self.random = None
class Solution:
# 返回 RandomListNode
def Clone(self, pHead):
# write code here
import copy
newHead = copy.deepcopy(pHead)
return newHead

浙公网安备 33010602011771号