Driver program
var head = newNode ( " " ) ; head . next = newNode ( " " ) ; head . next . next = newNode ( " " ) ; head . next . next . next = newNode ( " " ) ; head . next . next . next . next = newNode ( " " ) ; head . next . next . next . next . next = newNode ( " " ) ; head . next . next . next . next . next . next = newNode ( " " ) ; document . write ( " " ) ; printList ( head ) ; head = reverse ( head ) ; document . write ( " " ) ; printList ( head ) ;