Thursday, 31 July 2014

Set doesn't allow duplicates. But why?

Internally SET store element using HASHTABLE, which is a structure of Key value pairs.Here what the values passed by the SET is treated as Keys of HASHTABLE Internally. Keys are unique cannot be duplicated. That is the reason if you pass any duplicate value it return false and does not added to the SET

No comments:

Post a Comment