8 Apr
2015
8 Apr
'15
9:40 a.m.
Giacomo Drago wrote:
On 2015-03-24 19:32, Phil Endecott wrote:
Another way to get the same saving would be to have N normal flat_maps (where N is e.g. 2 or 3). Insert into whichever is currently smallest, and lookup in both. That has the same typical and worst-case complexity as a flat_map, but you can trade off (by constant factors) the cost of insertion vs. the cost of lookup and iteration by adjusting N.
This is simple and brilliant, and can help me with the actual scenario I am dealing with. Do you mind if I use this idea, and I appropriately mention you?
You're welcome, and there is no need for any attribution. Regards, Phil.