Questions tagged [hash-table]

The tag has no usage guidance.

14 questions with no upvoted or accepted answers
Filter by
Sorted by
Tagged with
1 vote
1 answer
438 views

My check function in speller isn't working

I have implemented everything else but this check function when I try to test it it seems like the the check function isn't working, because the no. of misspelled words is the same as the no. in text.....
Ojou Nii's user avatar
  • 721
1 vote
0 answers
110 views

Is hash table a type of dictionary?

In week 7 shorts for trie it is said that "a dictionary is a type of data structure that maps a key (usually string) to value". So is hash table considered a dictionary too?
Avi's user avatar
  • 93
1 vote
2 answers
7k views

PSET5 Speller hash function

I have been working on the speller problem in pset5 for a while now, and I am not able to figure out the problem in my hash function: unsigned int hash(const char* word) { int M = 1000000001; ...
Shrey Tripathi's user avatar
0 votes
1 answer
15 views

I can't reproduce a behavior to the hash table and the first node

1st. In dictionary.c the line: node *table[N]; declares an array of pointers or an array of nodes? 2nd. When I code: table[index] = n; table receive a value for ->word and ->next? or just ...
Maurício Mota's user avatar
0 votes
1 answer
249 views

CS50 Pset5 Speller

I am having problems with Pset 5 Speller. I believe, I'm nearly there, I can get all functions to run and compile successfully, however my outputs are not quite right. I have attached comments to make ...
Ciaran Egan's user avatar
0 votes
1 answer
78 views

PSET 5 My hash table doesn't seem to be storing correctly

When I load the dictionary, I add the words to the hash table, by calling the hash function to calculate the bucket ID, then add hash function to actually insert it into the list. Inside the addhash ...
Jamie Walker's user avatar
0 votes
1 answer
24 views

Pset4: dictionaries with hashtable -- every word is misspelled

I'm getting every word is misspelled when I run ./speller dictionaries/large texts/pneumonoultramicroscopicsilicovolcanoconiosis.txt When I run help50: Sorry, help50 does not yet know how to help ...
Pexan's user avatar
  • 19
0 votes
0 answers
159 views

Speller - Valgrind - Blocks Are Still Reachable

Valgrind indicates 32 bytes in 1 block still reachable. My speller seems to work in all other respects based on my own testing and Check50 (except final memory check). Since I do not see any valgrind ...
mdisandro2's user avatar
0 votes
1 answer
291 views

CS50 pset 4 speller - qualifies for bigboard

My code qualifies with check50, valgrind and style 50. But when I want to submit it to big board it says "timed out while waiting for program to exit" Here's my dictionary.c - // Implements a ...
Intiser Rajoan Parash's user avatar
0 votes
1 answer
44 views

"check" function in pset4, problem with hashtable and pointers

I'm getting an pesky error when trying to compile my code. error: use of undeclared identifier 'hashtable' first = hashtable[i]; My code, per below, is an attemp to implement the check function ...
Victor's user avatar
  • 1
0 votes
2 answers
547 views

How can I debug my load() function in Speller?

So I have code that I feel as though should be working, but I'm having trouble checking my work. I wrote a function that I think loops through my table, but it only displays half of the data seemingly....
Colin Thrapp's user avatar
0 votes
1 answer
26 views

Why am I able to insert an element into a hash tree via Main() but not via a function call?

I'm fairly certain this has something to do with pointers and the function using copies instead, but I'm not sure how...because I've inserted the pointer as a parameter for create(); #include <...
Krishaan Khubchand's user avatar
0 votes
0 answers
65 views

Printf prints newline character instead of string in Pset5

I'm working on the Speller program in Pset5. As always, i'm using a modular approach to construct all the required constituent functions one by one. However, something quite odd is happening in my ...
PvtWitt's user avatar
0 votes
1 answer
259 views

pset6 load seg faulting when accessing malloc'd node

I need some guidance on where I'm going wrong here. GDB runs fine until I try to access the "next" property of a node to see if it's NULL. Am I just confusing how the node structure works? My ...
gedm's user avatar
  • 1