Facebook | E4 | Seattle | Phone Interview
Anonymous User
722

I got a one coding question.

public class Node{
	public char value;   // this value is not unique
	public Node next;    // pointer for next node
	public Node random; // pointer for any random node in the list
	
	public Node( value){
	this.value = value;
}

//example the next pointer 1-> 2->3->4
// example random pointer 1->3, 2-> null., 3-> null , 4-->1

You have implement a method to clone this List

Node clone( Node root){
// you have to clone the list and return root Node of new list
// your code
}
Comments (1)