why linked list are not sorted?
问题 I try to make linked list for string and sort with their score but my sorting algorithm is doing nothing. Thank you for any advice and help. void SortList(Linked_List *list) { Node *temp, *index = NULL; temp = list->head; int tmp; if (list->head == NULL) { return; } else { while (temp != NULL) { index = temp->next; while (index != NULL) { if (temp->score > index->score) { tmp = temp->score; temp->score = index->score; index->score = tmp; } index = index->next; } temp = temp->next; } } } here