What is the time and space complexity (use big O notation) of this function? Answer briefly, not more than 2-3 lines.

icon
Related questions
Question

2) What is the time and space complexity (use big O notation) of this function? Answer briefly, not more than 2-3 lines.

def all_cubes (items):
result = []
for item in items:
result.append(pow(item, 2))
print (result)
items = [2,3,4,5,6,7]
all_cubes (items)
Transcribed Image Text:def all_cubes (items): result = [] for item in items: result.append(pow(item, 2)) print (result) items = [2,3,4,5,6,7] all_cubes (items)
Expert Solution
steps

Step by step

Solved in 3 steps

Blurred answer
Similar questions