About 50 results
Open links in new tab
  1. Pythonic way to find maximum value and its index in a list?

    This tells max to find the largest number in the list [0, 1, 2, ..., len(a)], using the custom function lambda x: a[x], which says that 0 is actually 2, 1 is actually 9, etc.

  2. python - How can I find smallest and largest number with inputs not ...

    Aug 24, 2020 · How can I find smallest and largest number with inputs not using min () nor max () Asked 5 years, 5 months ago Modified 5 years, 5 months ago Viewed 3k times

  3. Find the greatest (largest, maximum) number in a list of numbers

    Mar 8, 2023 · How can I easily find the greatest number in a given list of numbers? See also How do I find the maximum (larger, greater) of 2 numbers? - in that special case, the two values can also be …

  4. Get the second largest number in a list in linear time

    In other words, for practically every number in the list, two comparisons were made, whereas one comparison mostly suffices – if the number is not larger than the second largest, it's not larger than …

  5. Find the second largest number in array - Stack Overflow

    Dec 7, 2017 · Here's the simplest way to get the second largest number and it's respective position from an array without rearranging the array or without using sorting method.

  6. Define a function to find largest number in a list - Stack Overflow

    Sep 22, 2014 · Define a function to find largest number in a list Asked 11 years, 4 months ago Modified 11 years, 4 months ago Viewed 9k times

  7. Program to find largest and second largest number in array

    Feb 23, 2017 · Well, look at your logic for deciding on the second largest number. You first set it to be equal to the first element in the array and then you go through the array and change the index if the …

  8. How to find second largest number in a list? [duplicate]

    Mar 30, 2018 · What if the largest and the second largest number are in the same side of your divide? [-10, -5, 10, 20] for example? Your method will not capture -5 rather than the desired 10. Consider …

  9. Python: Recursive function to find the largest number in the list

    5 I'm trying to do a lab work from the textbook Zelle Python Programming The question asked me to "write and test a recursive function max() to find the largest number in a list. The max is the larger of …

  10. How to find second largest number in an array in Java?

    Nov 13, 2012 · Largest number and second largest number are retrieved in one pass. This code only fails if array only contains multiple copy of same number like {8,8,8,8} or having only one number.