static void updateParent ( int parent [ ] , Node node ) {
  if ( node == null ) return ;
  if ( node . left != null ) parent [ node . left . data ] = node . data ;
  if ( node . right != null ) parent [ node . right . data ] = node . data ;
  updateParent ( parent , node . left ) ;
  updateParent ( parent , node . right ) ;
}

static void updateParent ( int parent [ ] , Node node ) { if ( node == null ) return ; if ( node . left != null ) parent [ node . left . data ] = node . data ; if ( node . right != null ) parent [ node . right . data ] = node . data ; updateParent ( parent , node . left ) ; updateParent ( parent , node . right ) ; }
(method_declaration (modifiers) type: (void_type) name: (identifier) parameters: (formal_parameters (formal_parameter type: (integral_type) name: (identifier) dimensions: (dimensions)) (formal_parameter type: (type_identifier) name: (identifier))) body: (block (if_statement condition: (parenthesized_expression (binary_expression left: (identifier) right: (null_literal))) consequence: (return_statement)) (if_statement condition: (parenthesized_expression (binary_expression left: (field_access object: (identifier) field: (identifier)) right: (null_literal))) consequence: (expression_statement (assignment_expression left: (array_access array: (identifier) index: (field_access object: (field_access object: (identifier) field: (identifier)) field: (identifier))) right: (field_access object: (identifier) field: (identifier))))) (if_statement condition: (parenthesized_expression (binary_expression left: (field_access object: (identifier) field: (identifier)) right: (null_literal))) consequence: (expression_statement (assignment_expression left: (array_access array: (identifier) index: (field_access object: (field_access object: (identifier) field: (identifier)) field: (identifier))) right: (field_access object: (identifier) field: (identifier))))) (expression_statement (method_invocation name: (identifier) arguments: (argument_list (identifier) (field_access object: (identifier) field: (identifier))))) (expression_statement (method_invocation name: (identifier) arguments: (argument_list (identifier) (field_access object: (identifier) field: (identifier)))))))