in reply to Re: mapping lists
in thread mapping lists

And how am I supposed to do a binary search for somethign that doesn't exist in the tree?

--
I'm not belgian but I play one on TV.

Replies are listed 'Best First'.
Re: Re: Re: mapping lists
by tall_man (Parson) on Jan 24, 2003 at 20:23 UTC
    It's not a problem for a binary search that the value does not exist in the tree. It will find the nearest place for it.

    Here is an excerpt from the binary search documentation:

    use Search::Binary; $pos = binary_search($min, $max, $val, $read, $handle, [$size]);

    "binary_search" implements a generic binary search algo­rithm returning the position of the first record whose index value is greater than or equal to $val.