posted 16 years ago
To give you a formula for this, the value returned in case of unsuccessful searches will be (-insertionpoint-1), where "insertionpoint" is the zero-based index location where the element could have been inserted.
Taken from: Pg #577, K&B-310-065.
So, for an array of 5 elements, the index locations are from 0 to 4. Hence, on the other end, a new element can be inserted at index 5. As per the formula, the method returns (-5-1) which is -6.
So, the range of values is -6 till 4
[ October 10, 2008: Message edited by: Rekha Srinath ]