随笔分类 -  算法

对常见的应用归纳其算法
摘要:把电子磅秤,1吨电子磅秤,2吨电子磅秤,3吨电子磅秤改成1吨电子磅秤,3吨电子磅秤,2吨电子磅秤,电子磅秤private void button1_Click(object sender, EventArgs e) { string strArr = txtSource.Text.Trim(); string[] SourceStr= strArr.Split(new char[2] { ',', ',' }); //支持中英文逗号 string[]NewStr = RandomSort(SourceStr); string strResult="&q 阅读全文
posted @ 2011-08-08 13:40 金码 阅读(1307) 评论(0) 推荐(0)
摘要:非递归算法求Fibonacci比递归算法效率更优!public static int Fibonacci(int n) { int Result = 1; int temp1 = 0, temp2 = 1, j = 3; if (n == 1) { Result = 1; return Result; } else if (n == 2) { Result = 1; return Result; } while (j = n) { temp1 = temp2; temp2 = Result; Result = temp1 + temp2; j++; } return Result; } 阅读全文
posted @ 2010-12-23 16:15 金码 阅读(330) 评论(2) 推荐(0)