Suggested Steps to Implement freq
1st check point
-
ignore options
-
ignore counts
-
simply read the files (or stdin) and output words
2nd check point
-
parse options
-
shift args (argc--, argv++)
-
strtol
-
show usage if invalid options
3rd check point
create a table of words
convert table to array
print array
4th check point
-
sort array
-
handle [-+]<n> and [-+]a options
5th check point
-
create a table of characters
-
create a table of lines
-
handle -f option
6th check point
-
test on big files, e.g., /usr/dict/words
-
get rid of memory leaks, e.g., Table_free() frees the keys, but not the
values