Following is the time complexity analysis for sets:
Sets | Complexity |
Add an element | O(1) |
Remove an element | O(1) |
Copy | O(n) |
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.