replace random pivot with median3 method for performance
Add -O3 to optimize the clang++ compiler
Test sorted input