Question: Q 1 . 1 2 ( 2 points ) Consider the following python code that accepts an array of size n: def whatami 2 (

Q1.12(2 points) Consider the following python code that accepts an array of size n:
def whatami2(x):
# Create an array of size 4 with each entry as ""
tmp =[""]*4
for i in len(x):
if i == len(tmp):
tmp2=[""]*(2* len(tmp))
for j in len(tmp):
tmp2[j]= tmp[j]
tmp = tmp2
tmp[i]= str(x[i])
return tmp
The O execution time for the code is:

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 Databases Questions!