Select candidate pivot with simple median method instead of random index