help with question from exam in c...
Given the following definition:
Code:
typedef struct node node;struct node{
char* str;
node* next;
};
And this function:
Code:
void what(node* x){ node *temp, *y;
if (!x)
return;
y = x->next;
while (y && x->str[strlen(x->str)-1] != y->str[0]) {
temp = y;
x->next = temp->next;
free(temp);
y = x->next;
}
what(y);
}
The List is:
Hello -> open -> all -> leave -> never -> radio -> table
1. What the new list after call to what(list)?
2. What is the function purpose is what?
Thanks!