int frip = 0; Number *outdex = NULL; Number *index = NULL; // display this from start to end tmp = start; fprintf(stdout, "BEFORE: "); while (tmp != NULL) { fprintf(stdout, "%2d ", tmp -> value); tmp = tmp -> next; } fprintf(stdout, "\n"); outdex = start; // start outdex at start of list while (outdex != NULL) // keep looping until we're done with list { frip = 0; // our sort flag index = start; // start index at start of list while (index -> next != NULL) // loop through the list { if (index -> value < index -> next -> value) { index -> value = index -> value ^ index -> next -> value; index -> next -> value = index -> value ^ index -> next -> value; index -> value = index -> value ^ index -> next -> value; frip = 1; } index = index -> next; } if (frip == 0) break; outdex = outdex -> next; } // display this from start to end tmp = start; fprintf(stdout, "AFTER: "); while (tmp != NULL) { fprintf(stdout, "%2d ", tmp -> value); tmp = tmp -> next; } fprintf(stdout, "\n"); return(0);