// scanning text and counting word frequencies
// note - can use stripWords to clean up words before sending to this program
#include <stdio.h>
#include <stdlib.h>
#include "bst_words.h"
int main(int argc, char * argv[]) {
tree_t * root = NULL;
char s[100];
tree_t * p;
while (scanf("%99s", s) == 1) {
p = bst_lookup(root, s);
if (p != NULL) (p->num)++;
else root = bst_insert(root, s, 1);
}
bst_print(root);
return 0;
}