面试题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

  

posted @ 2019-08-11 22:32  lililili——  阅读(111)  评论(0)    收藏  举报