Added  find median in logarithmic time