static boolean traverse ( int h ) {
  for ( int i = 0 ;
  i < d [ h ] ;
  i ++ ) {
    if ( g [ p [ h ] [ i ] ] ) return true ;
    else g [ p [ h ] [ i ] ] = true ;
    if ( traverse ( p [ h ] [ i ] ) ) return true ;
  }
  return false ;
}

static boolean traverse ( int h ) { for ( int i = 0 ; i < d [ h ] ; i ++ ) { if ( g [ p [ h ] [ i ] ] ) return true ; else g [ p [ h ] [ i ] ] = true ; if ( traverse ( p [ h ] [ i ] ) ) return true ; } return false ; }
(method_declaration (modifiers) type: (boolean_type) name: (identifier) parameters: (formal_parameters (formal_parameter type: (integral_type) name: (identifier))) body: (block (for_statement init: (local_variable_declaration type: (integral_type) declarator: (variable_declarator name: (identifier) value: (decimal_integer_literal))) condition: (binary_expression left: (identifier) right: (array_access array: (identifier) index: (identifier))) update: (update_expression (identifier)) body: (block (if_statement condition: (parenthesized_expression (array_access array: (identifier) index: (array_access array: (array_access array: (identifier) index: (identifier)) index: (identifier)))) consequence: (return_statement (true)) alternative: (expression_statement (assignment_expression left: (array_access array: (identifier) index: (array_access array: (array_access array: (identifier) index: (identifier)) index: (identifier))) right: (true)))) (if_statement condition: (parenthesized_expression (method_invocation name: (identifier) arguments: (argument_list (array_access array: (array_access array: (identifier) index: (identifier)) index: (identifier))))) consequence: (return_statement (true))))) (return_statement (false))))