text: utility function to print linked list
code: function printlist ( head ) { if ( head == null ) { document . write ( " " ) ; return ; } while ( head != null ) { document . write ( head . data + " " ) ; if ( head . next != null ) document . write ( " " ) ; head = head . next ; } document . write ( " " ) ; }