随笔分类 -  算法

摘要:全排序 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) < ... 阅读全文
posted @ 2013-05-30 10:43 小09牛 阅读(229) 评论(0) 推荐(0)
摘要:冒泡 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[... 阅读全文
posted @ 2013-05-29 16:02 小09牛 阅读(196) 评论(0) 推荐(0)
摘要:private void pai(ref char[] str, int m, int n) {            if (m < n)            {          ... 阅读全文
posted @ 2010-08-15 17:29 小09牛 阅读(128) 评论(0) 推荐(0)
摘要:using System;using System.Collections.Generic;using System.Linq;using System.Text;namespace quanpaixu{    class Program {         static void Mai... 阅读全文
posted @ 2010-08-15 15:34 小09牛 阅读(504) 评论(0) 推荐(0)
摘要://第一个是循环值,第二个是输出值,第三个是你要检索的字符串private void RandomSort1(int j,string s1,string test) {                  for (int i1 = j; i1 < test.Length; i1++... 阅读全文
posted @ 2010-08-15 15:33 小09牛 阅读(454) 评论(0) 推荐(0)