This explanation gives the detail I think you're looking for:
https://www.cs.duke.edu/courses/summer10/cps130/files/Edelsbrunner_Median.pdf
The median of the set plays a special role in this algorithm, and it is defined as the i-smallest item where i = (n+1)/2 if n is odd and i = n/2 or (n+2)/2 if n is even.