由买买提看人间百态

topics

全部话题 - 话题: posend
(共0页)
P********l
发帖数: 452
1
来自主题: JobHunting版 - 问一个算法题
http://www.sureinterview.com/shwqst/545001
code:
public void findRange(double[] data, double rangeStart, double rangeEnd,
Mutable pStart, Mutable pEnd) {
pStart.setValue(-1);
pEnd.setValue(-1);
if (data == null || data.length == 0)
return;
int posStart = 0, posEnd = data.length - 1;
// find where the data roughly is.
int inRange = 0;
while (posStart <= posEnd) {
inRange = (posStart + posEnd) / 2;
if (data[in... 阅读全帖
(共0页)