Answer from cs61c-ar (Albert Chung 15826273) for Question 2
struct tnode *addnode(char *s, struct tnode *p)  {

    char *cpyWord;
    struct tnode *t;


    t = (struct tnode *) malloc(sizeof(struct tnode));
     
    cpyWord = (char*) malloc(strlen(s)+1);
    if (cpyWord != NULL)
        strcpy(cpyWord, s);

    t->word = cpyWord;
    t->next = p;
    return t;
}

     
    
    

