In a given array how to find the 2nd, 3rd, 4th, or 5th values?
Also if we use the
max()
function in python what is the order of complexity i.e, associated with this functionmax()
?
.
def nth_largest(li,n): li.remove(max(li))print max(ele) //will give me the second largest#how to make a general algorithm to find the 2nd,3rd,4th highest value#n is the element to be found below the highest value