随笔分类 - 算法
摘要:全排序 1 static void AllSort(int[] arr, string rtnStr) 2 { 3 if (arr.Length == 0) 4 { 5 Console.WriteLine(rtnStr); 6 return; 7 } 8 9 int i = -1;10 string temp = rtnStr;11 12 while ((++i) < ...
阅读全文
摘要:冒泡 1 static void BubbleSort() 2 { 3 int[] array = new int[] { 7, 3, 5, 8, 2 }; 4 5 for (int i = 0; i < array.Length; i++) 6 { 7 for (int j = 0; j < array.Length - i - 1; j++) 8 { 9 if (array[j] > array[...
阅读全文
摘要:private void pai(ref char[] str, int m, int n) { if (m < n) { ...
阅读全文
摘要:using System;using System.Collections.Generic;using System.Linq;using System.Text;namespace quanpaixu{ class Program { static void Mai...
阅读全文
摘要://第一个是循环值,第二个是输出值,第三个是你要检索的字符串private void RandomSort1(int j,string s1,string test) { for (int i1 = j; i1 < test.Length; i1++...
阅读全文

浙公网安备 33010602011771号