Question: (3 mark) (1) Explain the worst-case, average-case and best-case analysis for the below program. K=[11,5,3,2,7,7.8,19,2.5,1.9,23.5,10,5] flag=0 flag1 = 1.5 key=? for j in range(len(K)): if

(3 mark) (1) Explain the worst-case, average-case and best-case analysis for the below program. K=[11,5,3,2,7,7.8,19,2.5,1.9,23.5,10,5] flag=0 flag1 = 1.5 key=? for j in range(len(K)): if K[i]==key: print("Element found at position", j+1) f=1.0+flag1 flag=1 if flag==0: print("Element not found")
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
