I have found some questions similar to this on the site but they do not give a deterministic solution , like the median of median approach which is only gives an approximate albeit low error value of the median.
Thus I am looking for a 'black box' algorithm that is complete in itself and is deterministic as an answer.