Howdy ranchers,
Ahmed wrote
per my understanding answer should be (-5 through 4) since inserion points evaluates as (-(insertion point) -1), so for eg last insertion point of index 4 should be (-4 -1) which is -5
No, the last insertion point is
behind the last entry, so if you have a sorted collection say:
(0, 1, 2, 3, 4)
and you do a binary search for number 5, which isn't in. Then the insertion point would be index 5 (after the four)
And as the returned value of a not-find is always
-(insertion point - 1)
the binary search should return -6.
Yours,
Bu.
[ July 19, 2007: Message edited by: Burkhard Hassel ]