Marketing of D - article topic ideas?

Simen kjaeraas simen.kjaras at gmail.com
Tue Jun 8 14:50:45 PDT 2010


Andrei Alexandrescu <SeeWebsiteForEmail at erdani.org> wrote

> max of n elements is O(n).

T max( T )( T[] values ) {
     T result = values[0];
     foreach ( i, e; values[1..$] ) {
         if ( max( values[i+1..$] ) > result ) {
             result = max( values[i+1..$] );
         }
     }
     return result;
}

-- 
Simen


More information about the Digitalmars-d mailing list