static void uniqueElements ( Node head ) {
  HashMap < Integer , Integer > hash = new HashMap < Integer , Integer > ( ) ;
  for ( Node temp = head ;
  temp != null ;
  temp = temp . next ) {
    if ( hash . containsKey ( temp . data ) ) {
      hash . put ( temp . data , hash . get ( temp . data ) + 1 ) ;
    }
    else {
      hash . put ( temp . data , 1 ) ;
    }
  }
  int count = 0 ;
  for ( Node temp = head ;
  temp != null ;
  temp = temp . next ) {
    if ( hash . get ( temp . data ) == 1 ) {
      System . out . print ( temp . data + " " ) ;
      count ++ ;
    }
  }
  if ( count == 0 ) System . out . print ( " No Unique Elements " ) ;
}

static void uniqueElements ( Node head ) { HashMap < Integer , Integer > hash = new HashMap < Integer , Integer > ( ) ; for ( Node temp = head ; temp != null ; temp = temp . next ) { if ( hash . containsKey ( temp . data ) ) { hash . put ( temp . data , hash . get ( temp . data ) + 1 ) ; } else { hash . put ( temp . data , 1 ) ; } } int count = 0 ; for ( Node temp = head ; temp != null ; temp = temp . next ) { if ( hash . get ( temp . data ) == 1 ) { System . out . print ( temp . data + " ▁ " ) ; count ++ ; } } if ( count == 0 ) System . out . print ( " ▁ No ▁ Unique ▁ Elements ▁ " ) ; }
(method_declaration (modifiers) type: (void_type) name: (identifier) parameters: (formal_parameters (formal_parameter type: (type_identifier) name: (identifier))) body: (block (local_variable_declaration type: (generic_type (type_identifier) (type_arguments (type_identifier) (type_identifier))) declarator: (variable_declarator name: (identifier) value: (object_creation_expression type: (generic_type (type_identifier) (type_arguments (type_identifier) (type_identifier))) arguments: (argument_list)))) (for_statement init: (local_variable_declaration type: (type_identifier) declarator: (variable_declarator name: (identifier) value: (identifier))) condition: (binary_expression left: (identifier) right: (null_literal)) update: (assignment_expression left: (identifier) right: (field_access object: (identifier) field: (identifier))) body: (block (if_statement condition: (parenthesized_expression (method_invocation object: (identifier) name: (identifier) arguments: (argument_list (field_access object: (identifier) field: (identifier))))) consequence: (block (expression_statement (method_invocation object: (identifier) name: (identifier) arguments: (argument_list (field_access object: (identifier) field: (identifier)) (binary_expression left: (method_invocation object: (identifier) name: (identifier) arguments: (argument_list (field_access object: (identifier) field: (identifier)))) right: (decimal_integer_literal)))))) alternative: (block (expression_statement (method_invocation object: (identifier) name: (identifier) arguments: (argument_list (field_access object: (identifier) field: (identifier)) (decimal_integer_literal)))))))) (local_variable_declaration type: (integral_type) declarator: (variable_declarator name: (identifier) value: (decimal_integer_literal))) (for_statement init: (local_variable_declaration type: (type_identifier) declarator: (variable_declarator name: (identifier) value: (identifier))) condition: (binary_expression left: (identifier) right: (null_literal)) update: (assignment_expression left: (identifier) right: (field_access object: (identifier) field: (identifier))) body: (block (if_statement condition: (parenthesized_expression (binary_expression left: (method_invocation object: (identifier) name: (identifier) arguments: (argument_list (field_access object: (identifier) field: (identifier)))) right: (decimal_integer_literal))) consequence: (block (expression_statement (method_invocation object: (field_access object: (identifier) field: (identifier)) name: (identifier) arguments: (argument_list (binary_expression left: (field_access object: (identifier) field: (identifier)) right: (string_literal))))) (expression_statement (update_expression (identifier))))))) (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 (string_literal)))))))