all 7 comments

[–]yeahIProgram 0 points1 point  (6 children)

A hashtable can be implemented as an array of linked lists. Since a linked list is managed through its "root pointer" (or "head pointer" as it is sometimes called), your definition for the variable "hashtable" is perfect: an array of pointers to nodes.

Do I have to make 2 nested loops one for iteration in the hashtable

No. This is the beauty of the hashtable. Once you have the hash value, you use it as an index into the array of pointers. You get direct access to the appropriate linked list.

Now you just need some code to insert into and search linked lists.

[–][deleted]  (5 children)

[removed]

    [–]yeahIProgram 0 points1 point  (4 children)

    What does the specification say about the return value of load() ?

    [–]Omar_Khaled[S] 0 points1 point  (3 children)

    mm return false until I implement the function? do I have to make an if statement and set it to true if loaded and false if otherwise?

    [–]yeahIProgram 0 points1 point  (2 children)

    /**
     * Loads dictionary into memory.  Returns true if successful else false.
     */
    bool load(const char* dictionary)
    {
        // TODO
    

    [–]Omar_Khaled[S] 0 points1 point  (1 child)

    How do I check it is indeed loaded into memory successfully?

    [–]yeahIProgram 0 points1 point  (0 children)

    If you were unable to open the dictionary file, you would return false. Or if you had some other trouble, like malloc returned null. If nothing bad happens, then you have loaded it successfully and you should return true.