Function which returns new linked list
function newList ( root1 , root2 ) { var ptr1 = root1 , ptr2 = root2 , ptr ; var root = null , temp ; while ( ptr1 != null ) { temp = new Node ( ) ; temp . next = null ;