Tool to find the minimum value in a list of numbers, that is to say the smallest possible value approaching 0 (if the numbers are positive) or minus infinity.
Minimum of a List - dCode
Tag(s) : Data Processing
dCode is free and its tools are a valuable help in games, maths, geocaching, puzzles and problems to solve every day!
A suggestion ? a feedback ? a bug ? an idea ? Write to dCode!
The minimum is the name given to the smallest value among a list of numbers (the greatest value is called the maximum).
To find the smallest value (the minimum) among a list of numbers, it is necessary to go through the whole list of numbers and compare their values one after the other. The minimum in the list is the smallest value found when all values have been compared.
Example: The list of 4 values: 8,2,4,6 has for minimum 2
For positive values, the minimum is the value closest to $ 0 $ and for negative values the minimum is the value that is closest to $ -\infty $ (minus infinity).
A naive algorithm for calculating a minimum of a list A of $ n $ integers is:function min(list) {
min = list[0]
for i = 1 , i < n {
if list[i] < min {
min = list[i]
}
}
return min
}
The complexity is of order $ n $, as there are $ n - 1 $ comparisons and in the worst case, $ n $ assignments (if the table is sorted by descending order) and in the best case only 1 assignment (if the minimum is the first value in the list).
dCode retains ownership of the "Minimum of a List" source code. Except explicit open source licence (indicated Creative Commons / free), the "Minimum of a List" algorithm, the applet or snippet (converter, solver, encryption / decryption, encoding / decoding, ciphering / deciphering, breaker, translator), or the "Minimum of a List" functions (calculate, convert, solve, decrypt / encrypt, decipher / cipher, decode / encode, translate) written in any informatic language (Python, Java, PHP, C#, Javascript, Matlab, etc.) and all data download, script, or API access for "Minimum of a List" are not public, same for offline use on PC, mobile, tablet, iPhone or Android app!
Reminder : dCode is free to use.
The copy-paste of the page "Minimum of a List" or any of its results, is allowed (even for commercial purposes) as long as you credit dCode!
Exporting results as a .csv or .txt file is free by clicking on the export icon
Cite as source (bibliography):
Minimum of a List on dCode.fr [online website], retrieved on 2024-11-21,