You can find it in your compiler's C++ include path.
When you #include <algorithm> you are including the file "algorithm" into your source code.
For my MinGW 4.4.0 it is found at "C:\MinGW\include\c++\algorithm" (but the exact path may vary for you).
Be warned, it's messy. The GCC "algorithm" file just includes some other files, notably "bits/stl_algobase.h" and "bits/stl_algo.h", which also include a lot of stuff needed for the algorithms code. (Remember, this is all generic code, highly optimized, so it is a bit harder to read than a more restricted implementation.)