There is no mention of average-case complexity for the multiple-sets intersection
on Python wiki:
https://wiki.python.org/moin/TimeComplexity
Only the worst-case complexity is given:
(n-1)*O(l) where l is max(len(s1),..,len(sn))
What is the average complexity of multiple-sets intersection
operation?
How is this operation implemented under the hood?
set.intersection(s1,s2,s2,s4 ...sn)
Is the multiple-sets intersection
operation implemented in a different way than the two-sets intersection
operation because their worst case complexities are different according to python-wiki:
2-sets intersection: O(len(s) * len(t))
Multiple-sets intersection: (n-1)*O(l) where l is max(len(s1),..,len(sn))
So the complexity of two sets using multiple-sets formula should be:
--> (2-1)*O(l) where l is max(len(s1), len(s2)`
--> O(max(len(s1), len(s2))
I think it is pretty different than the complexity notation of two set intersection operation.
On a side note, is there a better way than set intersection for membership check between different sets?
NOTE: I am looking for an explanation rather than just the complexity O() notation :)