Can a hashset contain duplicates?



Can a hashset contain duplicates?..

Answer / Mukesh Fattu Shivade

No, HashSet does not allow duplicate elements. Each element is added only once, and any subsequent attempt to add an existing element results in no change to the set.

Is This Answer Correct ?    0 Yes 0 No

Post New Answer

More Data Structures Interview Questions

Difference between calloc and malloc ?

1 Answers  


When would you use a tuple?

1 Answers  


What is the type of the algorithm used in solving the 8 Queens problem?

1 Answers  


What is Storage Structures and File Structures? Can you show their relation? What are the examples of each? Thanks

1 Answers  


What is data type and its types?

1 Answers  


Which is the parent class of sortedset<e> class?

1 Answers  


Now you are given an array of a characters (both ASCII and Kanji) and, an index into the array. The index points to the start of some character. Now you need to write a function to do a backspace (i.e. delete the character before the given index).

1 Answers  


Explain recursive function & what is the data structures used to perform recursion?

1 Answers   TCS,


Can array store heterogeneous data?

1 Answers  


Write a program using mergesort technique.

1 Answers   iNautix,


What is data and information explain with example?

1 Answers  


Are duplicates allowed in hashmap?

1 Answers  


Categories