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 ) && areIdenticalRecur ( a . next , b . next ) ;