Question: # Three-way set disjointness # Determine if A intersection B intersetion C is empty def disjoint1(A, B, C): for a in A: for b in
# Three-way set disjointness
# Determine if A intersection B intersetion C is empty
def disjoint1(A, B, C):
for a in A:
for b in B:
for c in C:
if a == b == c:
return False
return True
def disjoint2(A, B, C):
for a in A:
for b in B:
if a == b:
for c in C:
if a == c:
return False
return True
(35 XP) Problem'7 Show experimentally that disjoint1(A, B, C) has worst time performance than disjoint2(A, B, C)1. Use the time Python module to track running times for dis- tinct input sizes and graph running times against input sizes using the matplotlib Python module. (35 XP) Problem'7 Show experimentally that disjoint1(A, B, C) has worst time performance than disjoint2(A, B, C)1. Use the time Python module to track running times for dis- tinct input sizes and graph running times against input sizes using the matplotlib Python module
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
