// same sub-programs as sorting.c but different presentation and // more comments // Buble sort void CommentedBuble(int *toSort, // list of integer elements to sort int length) // length of this list { int indexElement; // index of current analyzed element in the list int modified; // true if two elements where swapped int temp; // temporary variable for values exchange modified = 1; // in order to make something while (modified) // loop because something to do { modified = 0; // maybe sort is finished for(indexElement=0;indexElement toSort[indexElement+1]) // two element in bad order { temp = toSort[indexElement]; // save value toSort[indexElement] = toSort[indexElement+1]; // put good value toSort[indexElement+1] = temp; // and other good value modified = 1; // sort is not finished } } } } // Selection sort void CommentedSelection(int *toSort, // list of integer elements to sort int length) { // length of this list int indexElement, j; // two index for examining elements of the list int posCurMin; // position of minimum value int temp; // temporary variable for values exchange for(indexElement=0;indexElement