A Fast Selection Algorithm and the Problem of Optimum Distribution of Effort