Sets maxSize to size of largest subtree with identical left and right . maxSize is set with size of the maximum sized subtree . It returns size of subtree rooted with current node . This size is used to keep track of maximum size .
int largestSubtreeUtil ( Node * root , string & str , int & maxSize , Node * & maxNode ) { if ( root == NULL ) return 0 ;