..but I am still lost... I couldn't even come up with a good answer that is E, as most of them answered.
Can anybody help me on this? Thank you!
SCJP/OCPJP 6 | SCWCD/OCPJWCD 5 | OCPJBCD in progress
Joined: Aug 23, 2007
What most people miss is the case where the insertion point would be AFTER ALL existing elements in the collection--ie, index 5. You know there are only five elements, so there is no index 5, only 0-4, but that is the point.
That is, if you had an ArrayList with a,b,c,d and e as its sorted elements, and then you searched on "f", the insertion point would be index 5--that's where it would have gone if it had been in the collection. Then you just negate it and subtract 1, due to the zero thing, as explained in the book.