@@ -0,0 +1,776 @@
+/**%0A * Definition for singly-linked list with a random pointer.%0A * class RandomListNode %7B%0A *     int label;%0A *     RandomListNode next, random;%0A *     RandomListNode(int x) %7B this.label = x; %7D%0A * %7D;%0A */%0Apublic class Copy_list_with_random_pointer %7B%0A    public RandomListNode copyRandomList(RandomListNode head) %7B%0A        if (head == null) %7B%0A            return null;%0A        %7D%0A        Map%3CRandomListNode, RandomListNode%3E map = new HashMap%3C%3E();%0A        for (RandomListNode n = head; n != null; n = n.next) %7B%0A            map.put(n, new RandomListNode(n.label));%0A        %7D%0A        for (RandomListNode n = head; n != null; n = n.next) %7B%0A            map.get(n).next = map.get(n.next);%0A            map.get(n).random = map.get(n.random);%0A        %7D%0A        return map.get(head);%0A    %7D%0A%7D

Add file Copy_list_with_random_pointer.java