if left and right subtrees are similar update maximum subtree if needed ( Note that left subtree may have a bigger value than right and vice versa )
size = ls + rs + 1 NEW_LINE if ( left [ 0 ] == right [ 0 ] ) : NEW_LINE INDENT if ( size > maxSize [ 0 ] ) : NEW_LINE INDENT maxSize [ 0 ] = size NEW_LINE maxNode [ 0 ] = root NEW_LINE DEDENT DEDENT