public static RandomListNode copyRandomList(RandomListNode head) {
    	if (null == head) return null;
        List<RandomListNode> newList = new ArrayList<RandomListNode>();
        Map<RandomListNode, Integer> rawmap = new HashMap<RandomListNode, Integer>();
        Map<Integer, RandomListNode> dstmap = new HashMap<Integer, RandomListNode>();
        RandomListNode p = head;
        
        int i = 1;
        while (null != p) {
        	RandomListNode node = new RandomListNode(p.label);
        	newList.add(node);
        	rawmap.put(p, i);
        	dstmap.put(i, node);
        	p = p.next;
        	i = i + 1;
        }
        for (int j = 0; j < newList.size() - 1; j++) {
        	newList.get(j).next = newList.get(j + 1);
        }
        RandomListNode r = newList.get(0);
        RandomListNode q = newList.get(0);
        p = head;
        while (null != p) {
        	RandomListNode rand = p.random;
        	if (null == rand) {p = p.next; q = q.next; continue;}
        	Integer it = rawmap.get(rand);
        	RandomListNode drand = dstmap.get(it);
        	q.random = drand;
        	q = q.next;
        	p = p.next;
        }
    	return r;
    }