Given a large unordered array of long
random numbers and a target long, what's the most efficient algorithm for finding the closest number?
@Test
public void findNearest() throws Exception {
final long[] numbers = {90L, 10L, 30L, 50L, 70L};
Assert.assertEquals("nearest", 10L, findNearest(numbers, 12L));
}