Copy a LinkedList that has a Random Pointer in it
- by Bragaadeesh
Hi,
First of all this is not a homework, this is an interview question that I got from a company I attended today.
You have a singly linked list with the Node structure as the following
class Node{
int data;
Node next;
Node random;
}
You have a typical singly linked list of length n. The random pointer in each node in the…