Question: write algorithm and determine worst case time compelxtiy me list to tridigonal matrix def list to tridigonal(u): lengthslen(u) sum length+2 nint (sum/) * Formation of

write algorithm and determine worst case time compelxtiy
me list to tridigonal matrix def list to tridigonal(u): lengthslen(u) sum length+2 nint (sum/) * Formation of no modrix of order on: B-[] for i in range(n): a=0) for j in range(n): a.append(e) B.append(a) for i in range(n): for k in range(i 2): B[i][k]-u[2*1+k] elif i!an-: for k in range(i-1, 1+2): B[i][k]-u[21+k) else: for k in range(1-1,n): 8[1]{k}-u{2+1k) print() U-[5, 7, 1, 4, 3, 4, 3, 4, 2, 4] list_to_tridigonalu [[5, -7, 0, 0], [1, 4, 3, 0], [0, 9, -3, 6], [0, 0, 2, 4]]
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
