Jan-28-2018, 02:00 AM
I'm trying to see the runtime of s.intersection(t) that takes two sets s and t and returns a new set with all the elements that occur in both s and t.
So, for example, i want to try running |s| = 1000 and |t| = 1000
I tried
So, for example, i want to try running |s| = 1000 and |t| = 1000
I tried
import timeit for x in range(1000): t = timeit.Timer("s.intersection(t)", "s = set(1000)", "t = set(1000)") t.timeit()I keep getting errors no matter what variation I try of Timer(). Any ideas?