Question: Python- This algorithm is O(n log(n) Please improve it to be linear import random list [10] for i in range (0, 10): nrandom. randint (0,

Python- This algorithm is O(n log(n) Please improve it to be linear import random list [10] for i in range (0, 10): nrandom. randint (0, 1000) list.append (n) list.sort () print (list) k - int (input ("Enter value of k: ) if (k>-0 and k
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
