public static void main ( String [ ] args ) {
  Node root1 = newNode ( 5 ) ;
  Node root2 = newNode ( 5 ) ;
  root1 . left = newNode ( 3 ) ;
  root1 . right = newNode ( 8 ) ;
  root1 . left . left = newNode ( 2 ) ;
  root1 . left . right = newNode ( 4 ) ;
  root2 . left = newNode ( 3 ) ;
  root2 . right = newNode ( 8 ) ;
  root2 . left . left = newNode ( 2 ) ;
  root2 . left . right = newNode ( 4 ) ;
  if ( isIdentical ( root1 , root2 ) == 1 ) System . out . print ( "Both BSTs are identical" ) ;
  else System . out . print ( "BSTs are not identical" ) ;
}

public static void main ( String [ ] args ) { Node root1 = newNode ( 5 ) ; Node root2 = newNode ( 5 ) ; root1 . left = newNode ( 3 ) ; root1 . right = newNode ( 8 ) ; root1 . left . left = newNode ( 2 ) ; root1 . left . right = newNode ( 4 ) ; root2 . left = newNode ( 3 ) ; root2 . right = newNode ( 8 ) ; root2 . left . left = newNode ( 2 ) ; root2 . left . right = newNode ( 4 ) ; if ( isIdentical ( root1 , root2 ) == 1 ) System . out . print ( " Both ▁ BSTs ▁ are ▁ identical " ) ; else System . out . print ( " BSTs ▁ are ▁ not ▁ identical " ) ; }
(method_declaration (modifiers) type: (void_type) name: (identifier) parameters: (formal_parameters (formal_parameter type: (array_type element: (type_identifier) dimensions: (dimensions)) name: (identifier))) body: (block (local_variable_declaration type: (type_identifier) declarator: (variable_declarator name: (identifier) value: (method_invocation name: (identifier) arguments: (argument_list (decimal_integer_literal))))) (local_variable_declaration type: (type_identifier) declarator: (variable_declarator name: (identifier) value: (method_invocation name: (identifier) arguments: (argument_list (decimal_integer_literal))))) (expression_statement (assignment_expression left: (field_access object: (identifier) field: (identifier)) right: (method_invocation name: (identifier) arguments: (argument_list (decimal_integer_literal))))) (expression_statement (assignment_expression left: (field_access object: (identifier) field: (identifier)) right: (method_invocation name: (identifier) arguments: (argument_list (decimal_integer_literal))))) (expression_statement (assignment_expression left: (field_access object: (field_access object: (identifier) field: (identifier)) field: (identifier)) right: (method_invocation name: (identifier) arguments: (argument_list (decimal_integer_literal))))) (expression_statement (assignment_expression left: (field_access object: (field_access object: (identifier) field: (identifier)) field: (identifier)) right: (method_invocation name: (identifier) arguments: (argument_list (decimal_integer_literal))))) (expression_statement (assignment_expression left: (field_access object: (identifier) field: (identifier)) right: (method_invocation name: (identifier) arguments: (argument_list (decimal_integer_literal))))) (expression_statement (assignment_expression left: (field_access object: (identifier) field: (identifier)) right: (method_invocation name: (identifier) arguments: (argument_list (decimal_integer_literal))))) (expression_statement (assignment_expression left: (field_access object: (field_access object: (identifier) field: (identifier)) field: (identifier)) right: (method_invocation name: (identifier) arguments: (argument_list (decimal_integer_literal))))) (expression_statement (assignment_expression left: (field_access object: (field_access object: (identifier) field: (identifier)) field: (identifier)) right: (method_invocation name: (identifier) arguments: (argument_list (decimal_integer_literal))))) (if_statement condition: (parenthesized_expression (binary_expression left: (method_invocation name: (identifier) arguments: (argument_list (identifier) (identifier))) right: (decimal_integer_literal))) consequence: (expression_statement (method_invocation object: (field_access object: (identifier) field: (identifier)) name: (identifier) arguments: (argument_list (string_literal)))) alternative: (expression_statement (method_invocation object: (field_access object: (identifier) field: (identifier)) name: (identifier) arguments: (argument_list (string_literal)))))))