hmm i'm still having trouble figuring out what
this should equal to = temp;
for example if i have
Code:
[first node] city 1
[second node] city 2
temp2 = temp->next; /* temp2 now equals to city 2 */
temp->next = temp2; /* this just assigns city 2 to city 2 because temp->next is city 2 and temp 2 is city2 from the previous line*/
??? = temp; /* no idea what temp should equal to possibly current because we want the first element to equal to second one*/
the following; has no effect, it just prints the ordered list.
Code:
temp2 = temp->next;
temp->next = temp2;
current->next = temp