Question: Find out the time and space complexity for the following two functions: def print _ distinct _ pairs ( l ) : for i in

Find out the time and space complexity for the following two functions:
def print_distinct_pairs(l):
for i in range(len(l)):
for j in range(i+1, len(l)):
if l[i]!= l[j]:
print(f"{l[i]}{l[j]}")
def blah(l):
for i in range(len(l)):
result =[]
for j in range(len(l)):
for k in range(len(l)):
result.append(l[i]+ l[j]- l[k])
return result
Find out the time and space complexity for the

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!