Fix an error where the best case is not log(n).