static int getMaxXor ( Node root , int n , int val , int x ) {
  int parent [ ] = new int [ n + 1 ] ;
  updateParent ( parent , root ) ;
  int max = x ^ val ;
  val = parent [ val ] ;
  while ( val != 0 ) {
    max = Math . max ( max , x ^ val ) ;
    val = parent [ val ] ;
  }
  return max ;
}

static int getMaxXor ( Node root , int n , int val , int x ) { int parent [ ] = new int [ n + 1 ] ; updateParent ( parent , root ) ; int max = x ^ val ; val = parent [ val ] ; while ( val != 0 ) { max = Math . max ( max , x ^ val ) ; val = parent [ val ] ; } return max ; }
(method_declaration (modifiers) type: (integral_type) name: (identifier) parameters: (formal_parameters (formal_parameter type: (type_identifier) name: (identifier)) (formal_parameter type: (integral_type) name: (identifier)) (formal_parameter type: (integral_type) name: (identifier)) (formal_parameter type: (integral_type) name: (identifier))) body: (block (local_variable_declaration type: (integral_type) declarator: (variable_declarator name: (identifier) dimensions: (dimensions) value: (array_creation_expression type: (integral_type) dimensions: (dimensions_expr (binary_expression left: (identifier) right: (decimal_integer_literal)))))) (expression_statement (method_invocation name: (identifier) arguments: (argument_list (identifier) (identifier)))) (local_variable_declaration type: (integral_type) declarator: (variable_declarator name: (identifier) value: (binary_expression left: (identifier) right: (identifier)))) (expression_statement (assignment_expression left: (identifier) right: (array_access array: (identifier) index: (identifier)))) (while_statement condition: (parenthesized_expression (binary_expression left: (identifier) right: (decimal_integer_literal))) body: (block (expression_statement (assignment_expression left: (identifier) right: (method_invocation object: (identifier) name: (identifier) arguments: (argument_list (identifier) (binary_expression left: (identifier) right: (identifier)))))) (expression_statement (assignment_expression left: (identifier) right: (array_access array: (identifier) index: (identifier)))))) (return_statement (identifier))))