PREV INDEX NEXT

Author: Stan Eisenstat
Subject: Re: [Cs223] Questions about hash table
Date: Monday, 06 Apr 2020, 18:45:54


    > Message Posted By: Unknown
    >
    > A few questions about Hwk5:
    >
    > 1. We don't need to store POSITION in the hash table because it's the key.
    > We only store REACHED-FROM and NSTEPS in the hash table. Is this right?

No, you must store POSITION.  The hash function tells
you in which search table to look for POSITION, but
does not encode POSItiON itself.
=====

    > 2. Should the arrays we use for chaining be arrays of structs so that we
    > can store REACHED-FROM and NSTEPS at a single index?

While it is easier to use an array of structs, you can
also use parallel arrays for POSITION, REACHED_FROM,
and NSTEPS.
=====

    > 3. Should we keep the strings of positions (e.g., "12345678-") as one
    > dimensional character arrays or would it help to rearrange them into two
    > dimension character arrays that resemble the puzzle tray?

Hwk5/Nine20 uses strings.

--Stan-
PREV INDEX NEXT