#include #include struct node { struct node *next; char character; }; // count_vowel_word_boundaries should return the number of vowel word boundaries // in the given linked list. // // A vowel word boundary occurs when a node containing a vowel is immediately // followed by a node containing a consonant. // - The list will only contain lowercase characters (from a to z). // - A vowel is one of the following characters: a, e, i, o, u. // - A consonant is any character that is not a vowel. int count_vowel_word_boundaries(struct node *head) { // PUT YOUR CODE HERE, DON'T FORGET TO CHANGE THE RETURN! return 42; } //////////////////////////////////////////////////////////////////////// // DO NOT CHANGE THE CODE BELOW // //////////////////////////////////////////////////////////////////////// int count_vowel_word_boundaries(struct node *head); struct node *list_from_string(char *string); // DO NOT CHANGE THIS MAIN FUNCTION int main(int argc, char *argv[]) { // create linked list from command line arguments struct node *head = NULL; if (argc > 1) { head = list_from_string(argv[1]); } // If you're getting an error here, // you have returned an uninitialized value printf("%d\n", count_vowel_word_boundaries(head)); return 0; } // DO NOT CHANGE THIS FUNCTION // create a linked list of chars from a string struct node *list_from_string(char *string) { struct node *head = NULL; struct node *tail = NULL; for (int i = 0; string[i] != '\0'; i++) { struct node *new = malloc(sizeof(struct node)); new->next = NULL; new->character = string[i]; if (head == NULL) { head = new; tail = new; } else { tail->next = new; tail = new; } } return head; }