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 .
static pair largestSubtreeUtil ( Node root , string str ) { if ( root == null ) return new pair ( 0 , str ) ;