static int isIdentical ( Node root1 , Node root2 ) {
  if ( root1 == null && root2 == null ) return 1 ;
  else if ( root1 != null && root2 == null ) return 0 ;
  else if ( root1 == null && root2 != null ) return 0 ;
  else {
    if ( root1 . data == root2 . data && isIdentical ( root1 . left , root2 . left ) == 1 && isIdentical ( root1 . right , root2 . right ) == 1 ) return 1 ;
    else return 0 ;
  }
}

static int isIdentical ( Node root1 , Node root2 ) { if ( root1 == null && root2 == null ) return 1 ; else if ( root1 != null && root2 == null ) return 0 ; else if ( root1 == null && root2 != null ) return 0 ; else { if ( root1 . data == root2 . data && isIdentical ( root1 . left , root2 . left ) == 1 && isIdentical ( root1 . right , root2 . right ) == 1 ) return 1 ; else return 0 ; } }
(method_declaration (modifiers) type: (integral_type) name: (identifier) parameters: (formal_parameters (formal_parameter type: (type_identifier) name: (identifier)) (formal_parameter type: (type_identifier) name: (identifier))) body: (block (if_statement condition: (parenthesized_expression (binary_expression left: (binary_expression left: (identifier) right: (null_literal)) right: (binary_expression left: (identifier) right: (null_literal)))) consequence: (return_statement (decimal_integer_literal)) alternative: (if_statement condition: (parenthesized_expression (binary_expression left: (binary_expression left: (identifier) right: (null_literal)) right: (binary_expression left: (identifier) right: (null_literal)))) consequence: (return_statement (decimal_integer_literal)) alternative: (if_statement condition: (parenthesized_expression (binary_expression left: (binary_expression left: (identifier) right: (null_literal)) right: (binary_expression left: (identifier) right: (null_literal)))) consequence: (return_statement (decimal_integer_literal)) alternative: (block (if_statement condition: (parenthesized_expression (binary_expression left: (binary_expression left: (binary_expression left: (field_access object: (identifier) field: (identifier)) right: (field_access object: (identifier) field: (identifier))) right: (binary_expression left: (method_invocation name: (identifier) arguments: (argument_list (field_access object: (identifier) field: (identifier)) (field_access object: (identifier) field: (identifier)))) right: (decimal_integer_literal))) right: (binary_expression left: (method_invocation name: (identifier) arguments: (argument_list (field_access object: (identifier) field: (identifier)) (field_access object: (identifier) field: (identifier)))) right: (decimal_integer_literal)))) consequence: (return_statement (decimal_integer_literal)) alternative: (return_statement (decimal_integer_literal)))))))))