struct list * sort_list(struct list *head) { int i; struct list *p; struct list *one, *two; for (i = 0; i < 5; i++) { for (p = head; p != NULL && p->next != NULL; p = p->next) { if (strlen(p->word) > strlen(p->next->word)) { one = p; two = p->next; one->next = two->next; two->next = one; if (one == head) { head = two; } } } print_list(head); } return head; }