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 printdistinctpairsl:
for i in rangelenl:
for j in rangei lenl:
if li lj:
printflilj
def blahl:
for i in rangelenl:
result
for j in rangelenl:
for k in rangelenl:
result.appendli lj lk
return result
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
