摘要:
截半查找,跟顺序查找相似,但其效率更高,特别是数量越多的情况下,其基本形式为: 查找: int[] a = new int[8] { 4, 13, 22, 34, 41, 52, 64, 70 }; 输入要找的数: int find = Convert.ToInt32(Console.ReadLin 阅读全文
posted @ 2016-04-20 22:02
By_The_Way
阅读(144)
评论(0)
推荐(0)
摘要:
顺序查找,是指从一组顺序数字组中,查找所需要的数字,是否在其中的一种查找方式。其基本形式为: 首先定义一组数组: int[] a = new int[8] { 6, 10, 17, 22, 34, 42, 53, 61 }; 输入你想要查找的数字(将输入的数字字符串形式,转换为32位有符号整数): 阅读全文
posted @ 2016-04-20 21:44
By_The_Way
阅读(156)
评论(0)
推荐(0)
摘要:
冒泡排序,是一种将数组内的数字按照从大到小,或从小到大排序的一组编码,十分有助于对于杂乱数字的整理,其基本格式为: 首先建立一个数组: int[] a = new int[8] { 10, 9, 12, 17, 6, 3, 11, 8 }; for (int i=1;i<=a.Length-1 ;i 阅读全文
posted @ 2016-04-20 21:23
By_The_Way
阅读(134)
评论(0)
推荐(0)
浙公网安备 33010602011771号