PREV INDEX NEXT

Author: Stan Eisenstat
Subject: Re: [Cs223] Use of **
Date: Saturday, 18 Apr 2020, 13:47:44


    > Message Posted By: Unknown
    >
    > In Aspnes' hash table ADT, he writes
    >
    > struct dict {
    >     int size;
    >     int n;
    >     struct elt **table;
    > }
    >
    > Why doesn't he just write *table instead of **table?

Because his table field is an array of pointers to elt's
(each points to the head node of a linked list of elt's)
not an array of elt's.
=====

    > Also, to follow up on a previous post, what does it mean to declare a
    > field of bucket sizes with dict?

In the original suggestion a hash table is a struct A
with a pointer to an array of struct B's, each having a
size field and a pointer to an array of struct C's.

The alternative is a struct A with pointers to an array
of sizes and an array of pointers to struct C's; i.e.,
there is no struct B.

Best,

--Stan-
PREV INDEX NEXT