static int searchList ( Node start , int search ) {
  Node temp = start ;
  int count = 0 , flag = 0 , value ;
  if ( temp == null ) return - 1 ;
  else {
    while ( temp . next != start ) {
      count ++ ;
      if ( temp . data == search ) {
        flag = 1 ;
        count -- ;
        break ;
      }
      temp = temp . next ;
    }
    if ( temp . data == search ) {
      count ++ ;
      flag = 1 ;
    }
    if ( flag == 1 ) System . out . println ( "\n" + search + " found at location " + count ) ;
    else System . out . println ( "\n" + search + " not found" ) ;
  }
  return - 1 ;
}

static int searchList ( Node start , int search ) { Node temp = start ; int count = 0 , flag = 0 , value ; if ( temp == null ) return - 1 ; else { while ( temp . next != start ) { count ++ ; if ( temp . data == search ) { flag = 1 ; count -- ; break ; } temp = temp . next ; } if ( temp . data == search ) { count ++ ; flag = 1 ; } if ( flag == 1 ) System . out . println ( " \n " + search + " ▁ found ▁ at ▁ location ▁ " + count ) ; else System . out . println ( " \n " + search + " ▁ not ▁ found " ) ; } return - 1 ; }
(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))) body: (block (local_variable_declaration type: (type_identifier) declarator: (variable_declarator name: (identifier) value: (identifier))) (local_variable_declaration type: (integral_type) declarator: (variable_declarator name: (identifier) value: (decimal_integer_literal)) declarator: (variable_declarator name: (identifier) value: (decimal_integer_literal)) declarator: (variable_declarator name: (identifier))) (if_statement condition: (parenthesized_expression (binary_expression left: (identifier) right: (null_literal))) consequence: (return_statement (unary_expression operand: (decimal_integer_literal))) alternative: (block (while_statement condition: (parenthesized_expression (binary_expression left: (field_access object: (identifier) field: (identifier)) right: (identifier))) body: (block (expression_statement (update_expression (identifier))) (if_statement condition: (parenthesized_expression (binary_expression left: (field_access object: (identifier) field: (identifier)) right: (identifier))) consequence: (block (expression_statement (assignment_expression left: (identifier) right: (decimal_integer_literal))) (expression_statement (update_expression (identifier))) (break_statement))) (expression_statement (assignment_expression left: (identifier) right: (field_access object: (identifier) field: (identifier)))))) (if_statement condition: (parenthesized_expression (binary_expression left: (field_access object: (identifier) field: (identifier)) right: (identifier))) consequence: (block (expression_statement (update_expression (identifier))) (expression_statement (assignment_expression left: (identifier) right: (decimal_integer_literal))))) (if_statement condition: (parenthesized_expression (binary_expression left: (identifier) right: (decimal_integer_literal))) consequence: (expression_statement (method_invocation object: (field_access object: (identifier) field: (identifier)) name: (identifier) arguments: (argument_list (binary_expression left: (binary_expression left: (binary_expression left: (string_literal) right: (identifier)) right: (string_literal)) right: (identifier))))) alternative: (expression_statement (method_invocation object: (field_access object: (identifier) field: (identifier)) name: (identifier) arguments: (argument_list (binary_expression left: (binary_expression left: (string_literal) right: (identifier)) right: (string_literal)))))))) (return_statement (unary_expression operand: (decimal_integer_literal)))))