laziness, impatience, and hubris | |
PerlMonks |
Re: Heap structure for lookup?by RichardK (Parson) |
on May 27, 2015 at 09:18 UTC ( [id://1127952]=note: print w/replies, xml ) | Need Help?? |
I'd look at using a B-tree for this type of problem, lookups are efficient once the tree is created. Balancing the tree when adding or removing elements can be somewhat expensive, but b-trees don't need to be balancing as frequently as binary trees so it's not too bad. Many databases use b-trees -- but you seem to be ruling those out for some reason ;)
In Section
Seekers of Perl Wisdom
|
|