I believe my code is now foolproof. I will write up the pseudocode now. But I do h
You seem to be including mid
in the following search regardless of which side is larger. The recursive calls should both exclude mid
from their search space.
Also, for the comparison to be meaningful, the two groups being compared need to be of equal size. That will require some extra odd/even logic.