Append all nodes to form a string
temp = [ ] NEW_LINE while ( node is not None ) : NEW_LINE INDENT temp . append ( node . data ) NEW_LINE node = node . next NEW_LINE DEDENT string = " " . join ( temp ) NEW_LINE return self . isPalindromeUtil ( string ) NEW_LINE