PREV INDEX NEXT

Author: Stan Eisenstat
Subject: Re: [Cs323] Hash Table Clarification
Date: Friday, 30 Oct 2020, 20:59:17


    > Message Posted By: Unknown
    >
    > Under Note E of the spec is the following:
    >
    > Here are some hints on how to achieve a small footprint:
    > 1) If you allocate one array for all of the nodes in the hash table other
    > than the heads of the chains, how many bytes do you need to specify a node?
    >
    >
    > Could you please explain the rationale behind the first part of this hint?
    > Specifically how/why we are allocating "one array for all of the nodes in
    > the hash table other than the heads of the chains", and if this is the
    > recommended approach for constructing our hash table.

Hashing with chaining uses NCHAINS head nodes (one per
chain) and one node per item stored.  The hint asks how
many bytes are needed to specify the location of one of
the latter nodes if they are all allocated in a single
array rather than individually.

--Stan-
PREV INDEX NEXT