What algorithm used to in Set to avoid duplicates? : May I know What algorithm used to in Set to avoid duplicates ?  
I want to know just What is the name of the algorithm used to avoid the duplicates and If possible the same algorithm implementation as well. 