Function to print nodes in a given linked list
function printList ( start ) { var temp = start ; document . write ( " " ) ; while ( temp != null ) { document . write ( temp . data + " " ) ; temp = temp . next ; } }