File Minimum.h
↰ Parent directory (ADS/search)
The minimum of a vector A[ 0 .
Definition (ADS/search/Minimum.h)
Detailed Description
. n - 1 ] (section 1.2): min() keeps the minimum so far and compares it with each of the other items, n - 1 comparisons, which are needed, since each comparison can exclude at most one of the two items from being the minimum (section 2.6). argmin() gives the place of the minimum of A[ start .. end ], the first one if it occurs more than once.
The contracts [see File Contract.h]: argmin() needs start <= end < n and min() a vector that is not empty; that no item of the range is smaller than the one found is an audit, as costly as the search. The functions are defined in Minimum.tpp.
Montresor, Algoritmi e Strutture Dati, 2025, sections 1.2 and 2.7.1, https://algoritmicamente.it/materiali/libro/capitoli/cap01.pdf
- Donato Meoli
Dipartimento di Informatica Universita’ di Pisa
by Donato Meoli
Includes
ADS/Contract.h(File Contract.h)ADS/search/impl/Minimum.tppADS/sort/Sorted.h(File Sorted.h)algorithm(File AkraBazzi.h)cstddeffunctionalutilityvector