15-Nov-2013 22:41, H. S. Teoh пишет:
This isn't directly related to D (though the code will be in D), and I
thought this would be a good place to ask.
I'm trying to implement an algorithm that traverses a very large graph,
and I need some kind of data structure to keep track of which nodes have
been visited, that (1) allows reasonably fast lookups (preferably O(1)),
Store as a bit-flag in whatever structure that serves as node. It's
going to be the fastest anyway and you indeed get to use only 1 bit per
node (and given padding and whatnot you may already have a couple of
bytes to spare per node).
--
Dmitry Olshansky