code zhang method for median in c++