Src/prototype.c
// returns the index of the greatest value in the list
returns the index of the greatest value in the list
returns the index of the greatest value in the list
int argmax(double* l, size_t len){
    if (len == 0 || l == NULL) return -1; 
    double maximum = l[0];
    int maxindex = 0;
    for (int i = 0; i < len; i++){
        if (l[i] > maximum){
            maximum = l[i];
            maxindex = i;
        } 
    }
    return maxindex;
}
int argmax ( double * l , size_t len ) { if ( len == 0 || l == NULL ) return -1 ; double maximum = l [ 0 ] ; int maxindex = 0 ; for ( int i = 0 ; i < len ; i ++ ) { if ( l [ i ] > maximum ) { maximum = l [ i ] ; maxindex = i ; } } return maxindex ; }
returns the index of the greatest value in the list
returns the index of the greatest value in the list
//good error checking