At 2008-12-12T19:20:52Z, John Machin <sjmac...@lexicon.net> writes:

> (1) you meant "if balance > threshold:"

balance >= threshold.  We both mistyped.  :-)

> (2) sequential search can be very fast if the sequence is in
> descending order of probability of occurence ... you might like to
> consider reversing the order

Actually, I just wanted to point out a simplified version of the exact same
algorithm.  Given enough RAM and if the speed was indeed critical, you could
turn that into a tuple of interest rates and jump straight to rate[balance]
in O(1).
-- 
Kirk Strauser
The Day Companies
--
http://mail.python.org/mailman/listinfo/python-list

Reply via email to