Preparing for Job Review in the last two days. This section summarizes the three sorting algorithms mentioned in the internal sorting chapter of the data structure. Simple implementation.
// Sort. CPP: defines the entry point for the console application. // # include "stdafx. H "# include <stdio. h> void bubble (INT list [], int N) {int I, j, temp; for (I = 0; I <n; I ++) {for (j = 0; j <n-i-1; j ++) {If (list [J]> list [J + 1]) {temp = list [J]; list [J] = list [J + 1]; list [J + 1] = temp ;}}}} //************************************** ********** // Hill sorting //*********************** ************************* void shellinsert (INT list [], int DK, int Len) {int I, j; int temp; for (I = dk; I <Len; ++ I) {If (list [I] <list [I-dk]) {temp = list [I]; for (j = I-DK; j> = 0 & (temp <list [J]); j-= dk) {list [J + dk] = list [J];} list [J + dk] = temp ;}} void shellsort (INT list [], int Len) {int Dk = Len; while (DK> 0) {Dk = Dk/2; shellinsert (list, DK, Len );}} //************************************** ******************* // quick sorting //************** **************************************** * *** int partition (INT list [], int low, int high) {int lower tkey; lower tkey = list [low]; while (low