304人加入学习
(7人评价)
算法之夜
价格 免费
课程还未发布,不允许加入和购买

naive solution for finding mi:

mi = (li + hi) / 2

the sum of li and hi can potentially be greater than the memory size allocated for the data type, hence can cause errors.

 

improved solution for finding mi:

mi = li + (hi - li) / 2

[展开全文]