Hi,
This is related to SCJP5.0.It is regarding binary search which includes insertionpoint concept.i am not clear with insertionpoint concept and if anyone know abt this concept,please share with me and explain the output of the following program.
Question:
Given a properly prepared
String array containing five elements, which range of results could a
proper invocation of Arrays.binarySearch() produce?
A. 0 through 4
B. 0 through 5
C. -1 through 4
D. -1 through 5
E. -5 through 4
F. -5 through 5
G. -6 through 4
H. -6 through 5
Answer is G) -6 through 4.
i am not able to arrive at this output.please explain it in step by step .it will be helpful for me as i am preparing for SCJP5.0 certification.
Thanks in advance.