摘要: static int FindNumber(int[] array, int num) { int result = -1; if (array == null) { return result; } for (int i = 0; i < array.Length - 1; i++) { if (array[i] > array[i + 1]) ... 阅读全文
posted @ 2012-03-14 15:17 Ligeance 阅读(2935) 评论(0) 推荐(0) 编辑
摘要: static void InsertSort(int[] input) { if (input == null || input.Length == 0) { throw new Exception("input can't be empty."); } for (int i = 1; i < input.Length; i++) { if (input[i] < input[i - 1]) ... 阅读全文
posted @ 2012-03-14 15:02 Ligeance 阅读(176) 评论(0) 推荐(0) 编辑