Questions tagged [dictionary]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
0
votes
1answer
1k views

Valgrind still reachable memory

For my pset5 speller program valgrind is saying that i have still reachable memory. This is the output: HEAP SUMMARY: ==24516== in use at exit: 352 bytes in 1 blocks ==24516== total heap usage: ...
1
vote
1answer
583 views

CS50x 2015 pset5 check50 & submission problem

SITUATION I enrolled in CS50x in late 2014. The class ended on 12/31/2014 and I was not able to finish in time. Enrolled in CS50x3 in 2015 and re-submitting my completed work where appropriate. ...
0
votes
1answer
210 views

PSET5 What LOAD really supposed to do?

I'm starting Problem Set nb 5 and just need a couple more specifications to begin my implementation of LOAD. Is it good to assume that a lexicographically sorted dictionary corresponds to a ...
0
votes
1answer
209 views

Implementing a trie. Updated load function in dictionary.c causes more problems with valgrind

I've been trying to fix an error that valgrind indicated came from my load() function. So in the beginning I implemented load() like this: http://pastebin.com/57a2HPMg Doing so only produced 1 error ...
0
votes
1answer
2k views

Can't figure out memory leak pointed out by valgrind in dictionary.c

Having implemented the functions within dictionary.c, I tried running speller.c but was given the error double free or corruption (!prev). And so I ran speller.c through valgrind and got the message ...
0
votes
1answer
215 views

pset5 Misspellings - passes check50 - doesn't work with larger text file

I've been pulling my hair out over Misspellings and I've finally got it to the point where is passes check50. Though when I run the code with austinpowers.txt for example, it says I have 19188 ...
0
votes
1answer
92 views

Pset5 600 out 644 words misspelled. What am I missing?

I can't seem to figure out what I'm doing wrong here... It loads the correct amount of words and checks them but its missing some when it comes to finding the misspellings. Can anyone spot what I'm ...
0
votes
1answer
189 views

pset5 dictionary and valgrind

I am currently working on pset5 and having some issues with errors that were identified by valgrind. My dictionary program seems to run fine- it passes the check50 and it is almost as fast as the ...
0
votes
1answer
277 views

My program “works” just fine but it won't pass check50?

I'm having some issues debugging my program from Problem Set 5: Mispellings. Well after struggling a couple of hours, here's some background: 1. My check function seems to work just fine, as well as ...
0
votes
1answer
254 views

Speller - Tries - Check function does not work

I have implemented load successfully. When I run speller, words load until the end of file. However, my check function does not work and according to GDB, speller stops when appending chars to word, ...
1
vote
2answers
283 views

Problem in my unload function (double free or corruption)

so I have been straggling pset5 for some time and I end up getting double free or corruptionand don't now how to fix it. Here's my code : /* inside load() */ // some code if(head->children[b] == ...
0
votes
1answer
128 views

pset5 invalid reads/writes

My speller programs compile and run with no issues however valgrind doesn't seem to think so. I initially used malloc and manually initialised each pointer to null and the boolean to false. I have ...
0
votes
2answers
272 views

PSET5 - Help with Valgrind? error : “uninitialised value(s)”

I have ran speller in valgrind to see if there was memory leaks and its appears that all memory allocated have been freed. But, I get many errors of type : "Conditional jump or move depends on ...
0
votes
1answer
86 views

pset5: I am leaking all of my memory. What am I missing?

This problem set is becoming my bane. I have spent hours on it and I am still getting the same issues with valgrind (definitely losing 7 million bytes). I think my issues lie with load and check and ...
0
votes
2answers
1k views

Pset5 Speller - segmentation fault is driving me crazy!

Hey guys! I have been working on pset5 for a while and I keep on obtaining a seg fault. I have alreay run valgrind but it gives me no error. I cannot really see where is the problem. Any help will be ...
0
votes
1answer
23 views

changes to code in appliance not being applied

I am working on pset5 dictionary.c, I had it working and now it is not. I have been tinkering with the code but every time I save dictionary.c and then execute make dictionary.c, the response is "...
0
votes
1answer
117 views

Why does this PSET 5 Load function segfault?

typedef struct node { char word[LENGTH+1]; struct node* next; }node; node *bucket[65530]={NULL}; unsigned int count=0; bool load(const char* dictionary) { FILE* inptr = fopen(dictionary, "r"...
0
votes
1answer
207 views

PSET5 - CHECK returning… nothing?

I have one more questions about SPELLER. I've completed all my codes for load, check, size and unload. I'm now trying to debug all of them. It appears I have an error with my check function, which one ...
0
votes
1answer
32 views

Valgrind is saying strange things

I have implemented a trie whose leaf nodes branch off into linked lists that contain possible word endings, because I wanted to see if this would take less time to load. It does take less time to ...
0
votes
2answers
102 views

Dictionary.c problems (still not working)

My code works fine when I don't use the large dictionary, but when I do use it, I get a segmentation fault. When I use GDB, the problem is so far into the dictionary that it would take forever to get ...
1
vote
0answers
399 views

Hacker2 dictionary for crack

I want to write a program crack.c for hacker2, but I can't find a dictionary for it. In the task it is recommended to check /usr/share/dict/words, but there is no such directory in my application.
0
votes
1answer
535 views

Pset5: problem with inserting words into nodes

To start off, I'm not even sure if the reasoning behind this is correct because I felt totally lost at the beginning of the pset, but the program won't even compile because of this error: ...
1
vote
2answers
661 views

pset5 speller valgrind still reachable

I'm using a trie data structure to tackle the spell checker. The code works fine and is almost as fast as the staff's implementation. Even check50 is happy about it. But when I run valgrind it throws ...
0
votes
1answer
146 views

pset5 dictionary.c not working

In my dictionary.c file, I declared my own function called trieNavigate(), whose code is below. I use it for loading and for checking, and so it returns a bool and accepts 3 parameters: a char (that ...
0
votes
2answers
302 views

Invalid read/write errors in pset5

I have been trying to create a trie for storing my dictionary, and the code looks like it ought to work. However, when I run Valgrind on it, I get a number of read/write errors (mostly of size 4). In ...
0
votes
2answers
299 views

Valgrind errors at the end

I finally made my dicitionary.c work. It works all ok. But there are some errors at the end, when checking with valgrind, although it says no memory leaks. The error summary is: ERROR SUMMARY: ...
0
votes
1answer
589 views

Problem Set 5: Speller, Segmentation fault

I'm working through the "load" part of speller.c and running into problems... Here is a tiny snippet of my code to avoid breaking any rules: My hash_values are simple so A = 0, B = 1 C = 2 etc, and ...
1
vote
1answer
295 views

PSET5: Segmentation fault in load function

I get a segmentation fault whenever I run the program with the large dictionary, but not the small one, so I guess the error lies somewhere in load or unload but I can't localize it. The program also ...
0
votes
1answer
60 views

Initializing multiple variables inside a for loop

I have been working on the dictionary's "load" function in Problem Set 5, but I have a problem. I don't want to hard-code names for each node within my trie, which I am working on, but in order to ...
1
vote
1answer
36 views

spellchecker unload not freeing 1 block

What is not freeing!? [code snipped by mod] // end of load function (mod comment) return true; fclose(dict_file); } [code snipped by mod]
0
votes
0answers
359 views

PSET5 Speller: trouble with mispellings and tolower()

I am very close to getting my dictionary to word correctly, but I am having a small hiccup in my check function. In order to compare the word given in the check function to the dictionary, I first ...
0
votes
1answer
264 views

Pset5 dictionary.c is not producing correct output

I've implemented my load and check functions using tries. The program works fine and produces the output, but when I compared it against the output from staff's implementation, I found out that there ...
0
votes
1answer
229 views

Segmentation Fault in pset5

As part of the edX course, CS50, I'm trying to load all the dictionary information into an array of char pointers. This would give random access and therefore a pretty fast load and unload time. The ...
1
vote
1answer
504 views

how to compile dictionary.c? [duplicate]

I'm having trouble figuring out the problem with my load function. here's the weird error I get (I've never seen something like it): jharvard@appliance (~/Dropbox/pset5): make dictionary clang -ggdb3 ...
0
votes
1answer
168 views

Trie Spellchecker unload() - two allocs not freeing

My freeNode() function goes through each child of my root node and free()'s each of them from the bottom back up to the root. Two of the allocs are not being free()'d. #include <stdbool.h> #...
0
votes
1answer
925 views

pset5 dictionary: Misspellings differ when different hash functions used

I've been trying to figure this out and I really need help. When I run speller with a text file against the large dictionary, my code doesn't catch all the misspellings that are supposed to be in the ...
0
votes
0answers
65 views

compiling errors

I'm dealing with pset5 (speller.c), and I chose trie to run the program. when I compiled it, it said: dictionary.c:25:1: error: type specifier missing, defaults to 'int' [-Werror,-Wimplicit-int] root ...
0
votes
1answer
33 views

Data compression: dictionary encoding

I am reading Computer Science: An Overview Eleventh Edition By J. Glenn Brookshear I believe this book was once assigned as optional reading material for CS50x A typical dictionary in a word ...
0
votes
0answers
121 views

Can some help me understand why check isn't working

Here is what I have come up with. I am looking for maybe some guidance as to what is going on so I might fix it. Here the section in question. It never evaluates to true. if(current_Node-> ...
0
votes
1answer
54 views

losing node in the span of a few lines

#define NUM_NODES 27 int wordCount = 0; typedef struct trie { bool is_Word; struct trie* chilluns[27]; } trie; trie* current_Node; trie* root; /** * Loads dictionary into memory. Returns true if ...
0
votes
1answer
142 views

Speller Dictionary: Problem with Pointers

I am a bit confused by all the new things about pointers. We can access a the value of a pointer by dereferencing it. For example, if you have char* str, you access the information that str is ...
0
votes
2answers
1k views

Could not load dictionary in cs50 pset6

I have written the load code for pset6 which compiles but when I execute speller.c it returns "Could not load dictionary". I have tried using a homemade dictionary on my machine and the dictionary at ...
0
votes
0answers
249 views

pset6 check function - student result set doesnt match staff - works on small test, fails on big

I have a version of dictionary.c that has all of the functions completed and compiling. When I run ./speller on my small test sets it completes succesfully. When I run it using the following test, ...
1
vote
0answers
106 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?
0
votes
1answer
397 views

Implementing unload() in pset6 for trie

I've been struggling with freeing the nodes in pset6 for the past week. All other functions are completely ok. This is my implementation of node: typedef struct node { bool is_word; struct ...
1
vote
1answer
199 views

Where are the files from the “/home/cs50/pset6/dictionaries/” directory of the appliance?

I am doing the psets outside of the appliance, so I don't have access to the dictionary files and texts file for PSET "misspelling". Are these files distributed on their own somewhere?

1 2
3