add algorithm header for std::min, std::max

In my VS2013, `std::min` and `std::max` are undefined, only if

    #include <algorithm>

is added. Please help me to check and confirm this commit won't do side effects to other compilers.