[c++] Finding smallest value in an array most efficiently