public static int posOfFirstOne ( int arr [ ] ) {
  int l = 0 , h = 1 ;
  while ( arr [ h ] == 0 ) {
    l = h ;
    h = 2 * h ;
  }
  return indexOfFirstOne ( arr , l , h ) ;
}

public static int posOfFirstOne ( int arr [ ] ) { int l = 0 , h = 1 ; while ( arr [ h ] == 0 ) { l = h ; h = 2 * h ; } return indexOfFirstOne ( arr , l , h ) ; }
(method_declaration (modifiers) type: (integral_type) name: (identifier) parameters: (formal_parameters (formal_parameter type: (integral_type) name: (identifier) dimensions: (dimensions))) body: (block (local_variable_declaration type: (integral_type) declarator: (variable_declarator name: (identifier) value: (decimal_integer_literal)) declarator: (variable_declarator name: (identifier) value: (decimal_integer_literal))) (while_statement condition: (parenthesized_expression (binary_expression left: (array_access array: (identifier) index: (identifier)) right: (decimal_integer_literal))) body: (block (expression_statement (assignment_expression left: (identifier) right: (identifier))) (expression_statement (assignment_expression left: (identifier) right: (binary_expression left: (decimal_integer_literal) right: (identifier)))))) (return_statement (method_invocation name: (identifier) arguments: (argument_list (identifier) (identifier) (identifier))))))