If both lists are not empty , then data of current nodes must match , and same should be recursively true for rest of the nodes .
if ( a != NULL && b != NULL ) return ( a -> data == b -> data ) && areIdentical ( a -> next , b -> next ) ;