You are expected to complete this assignment individually. If you need help, you are invited to come to office hours and/or ask questions on piazza. Clarification questions about the assignments may be asked publicly. Once you have specific bugs related to your code, make the posts private.
This homework has a single problem that builds on your work from the warmup.
You should submit many files for this assignment ( llist.h, llist.c, queue.c, queue.h, bst.c, bst.h, hw6.h, hw6.c, test_hw6.c and Makefile) in your subversion repository as directed below.
You should already have your hw6 directory. If you participated in duet programming, make sure you copy over the files from the warm-up NOW.
bst* get_counts(char *filename);
This function takes in a filename. It reads in the file and splits the file into words. Words are broken by whitespace and punctuation of any kind. For simplicity, can't will be considered two words: "can" and "t". I suggest using fgets to read in the lines and strtok to divide the line into words.
Here is an example of a line of text and the words resulting from it:
hello, how are you? Welcome to CS152 today. We will study trees - bst's.
This function counts how many occurrences there are of each word. It then places them in a binary tree that is sorted by count so that the user can take that bst and print it out in order.
The important thing to remember is that the tree you use to count the words is different from the tree you return to the user. When you count the words, you look them up by word. When you return a tree to the user, the words need to be indexed by count, not word.
$ svn add *.c *.h Makefile
$ svn commit -m "hw6 complete"