reverse each node data
static String reverse_word ( String str ) { String s = " " ; for ( int i = 0 ; i < str . Length ; i ++ ) s = str [ i ] + s ; return s ; } static Node reverse ( Node head ) { Node ptr = head ;