Following is the time complexity analysis for sets:
An important thing to note from the complexity analysis of the sets is that the time taken to add an element is totally independent of the size of a particular set.