static int findlength ( node head ) {
  node curr = head ;
  int cnt = 0 ;
  while ( curr != null ) {
    cnt ++ ;
    curr = curr . next ;
  }
  return cnt ;
}

static int findlength ( node head ) { node curr = head ; int cnt = 0 ; while ( curr != null ) { cnt ++ ; curr = curr . next ; } return cnt ; }
(method_declaration (modifiers) type: (integral_type) name: (identifier) parameters: (formal_parameters (formal_parameter type: (type_identifier) 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))) (while_statement condition: (parenthesized_expression (binary_expression left: (identifier) right: (null_literal))) body: (block (expression_statement (update_expression (identifier))) (expression_statement (assignment_expression left: (identifier) right: (field_access object: (identifier) field: (identifier)))))) (return_statement (identifier))))