at_most: search "dictionary" for less than or equal

slais-www slais-www at ucl.ac.uk
Mon Aug 11 10:18:28 EDT 2008


Before I set out to reinvent the wheel.

I want a dictionary-like structure for which most lookups will be on a 
key that is not in the "dictionary"; in which case I want a key/value 
returned which is the closest key that is less than the search term.


The batch solution of matching the values in two sorted sequences is 
efficient but a random lookup would be more convenient. A solution based 
on AVL trees seems possible.


-- 
djc



More information about the Python-list mailing list