I am asked to find the run time of the general form of the median of medians algorithm for groups of size g. It seems from common examples g=3,5,7 with T(n)=T(n/5)+T(2n/3)+cn, T(n)=T(n/5)+T(7n/10)+cn, and T(n)=T(n/7)+T(5n/7)+cn, respectively, that the general for an odd number would be T(n)=T(n/g)+T(1-(n/(2g)*(g+1)/2))+cn.
However, I am struggling with what to use as median for an even number g where the median will exist between two elements and not actually in the set itself. I am told that I can ignore floors and ceilings. Intuition tells me it should simply be T(n)=T(n/g)+T(1-(n/(2g)*(g)/2))+cn, but I can't help but feel that I'm missing something.
Can anyone give advice on how the algorithm might work with groups of even numbers? I think I should be able to find the run time once I understand the algorithm.