C # sorting Algorithm I. Bubble Using system; namespace bubblesorter {public class bubblesorter {public void sort (INT [] list) {int I, j, temp; bool done = false; j = 1; while (j <list. length )&&(! Done) {done = true; for (I = 0; I <list. length-J; I ++) {If (list [I]> list [I + 1]) {done = false; temp = list [I]; list [I] = list [I + 1]; list [I + 1] = temp ;}} J ++ ;}} public class mainclass {public static void main () {int [] iarrary = new int [] {,}; bubblesorter SH = new bubblesorter (); SH. sort (iarrary); For (INT m = 0; m <iarrary. length; m ++) console. write ("{0}", iarrary [m]); console. writeline () ;}}ii. selection using system; namespace selectionsorter {public class selectionsorter {private int min; Public void sort (INT [] list) {for (INT I = 0; I <list. length-1; I ++) {min = I; for (Int J = I + 1; j <list. length; j ++) {If (list [J] <list [Min]) min = J;} int T = list [Min]; list [Min] = list [I]; list [I] = T ;}} public class mainclass {public static void main () {int [] iarrary = new int [] {,}; selectionsorter Ss = new selectionsorter (); SS. sort (iarrary); For (INT m = 0; m <iarrary. length; m ++) console. write ("{0}", iarrary [m]); console. writeline () ;}}3. insertionsorter using system; namespace insertionsorter {public class insertionsorter {public void sort (INT [] list) {for (INT I = 1; I <list. length; I ++) {int T = list [I]; Int J = I; while (j> 0) & (list [J-1]> T )) {list [J] = list [J-1]; -- J;} list [J] = T ;}} public class mainclass {public static void main () {int [] iarrary = new int [] {,}; insertionsorter II = new insertionsorter (); II. sort (iarrary); For (INT m = 0; m <iarrary. length; m ++) console. write ("{0}", iarrary [m]); console. writeline () ;}}4. shellsorter using system; namespace shellsorter {public class shellsorter {public void sort (INT [] list) {int Inc; for (INC = 1; INC <= List. length/9; Inc = 3 * Inc + 1); For (; INC> 0; INC/= 3) {for (INT I = inc + 1; I <= List. length; I + = Inc) {int T = list [I-1]; Int J = I; while (j> Inc) & (list [j-inc-1]> T )) {list [J-1] = list [j-inc-1]; j-= Inc;} list [J-1] = T ;}}} public class mainclass {public static void main () {int [] iarrary = new int [] {,}; shellsorter SH = new shellsorter (); SH. sort (iarrary); For (INT m = 0; m <iarrary. length; m ++) console. write ("{0}", iarrary [m]); console. writeline ();}}}