题库 软件开发 题目列表 给定一个链表,每个节点包含一个额外增加的随机指针,...
问答题
给定一个链表,每个节点包含一个额外增加的随机指针,该指针可以指向链表中的任何节点或空节点。
要求返回这个链表的深度拷贝。
/**
* Definition for singly-linked list with a random pointer.
* struct RandomListNode {
*     int label;
*     RandomListNode *next, *random;
*     RandomListNode(int x) : label(x), next(NULL), random(NULL) {}
* };
*/
example:
RandomListNode *copyRandomList(RandomListNode *head) {
}

题目信息
校招真题
-
正确率
0
评论
14
点击