List Info

Thread: hash table iteration




hash table iteration
user name
2006-11-09 19:53:29
On 11/9/06, Karl Fogel <kfogelred-bean.com> wrote:
> On 11/9/06, Jim Blandy <jimbred-bean.com> wrote:
> > To add an entry to the off-to-the-side list, just
stick the new
> > key/value pair at the end.  To remove an entry
from the
> > off-to-the-side list, you copy the key/value pair
at the end of the
> > list into the entry you're vacating, decrement the
length of the list,
> > and update its hash entry.
> >
> > Iterators can be simple indexes into the
off-to-the-side list.
>
> Hunh.  The off-to-the-side list is just used for
iterating, right?
> That is, you don't look at it when doing a standard
hash lookup?

You do use it for ordinary hash lookups.  The hash array no
longer
contains pointers to anything: it just holds indices into
the
off-to-the-side list.  Keys and values only appear in the
off-to-the-side list.

_______________________________________________
Minor mailing list
Minorred-bean.com
http:/
/www.red-bean.com/mailman/listinfo/minor
[1]

about | contact  Other archives ( Real Estate discussion Medical topics )