摘要: private static int BinarySearch(T[] array, int index, int length, T value){ int lo = index; int hi = index + length - 1; while (lo <= hi) { int i = lo + ((hi - lo) >> 1); int order; if (array[i] == null) { order = (value == null) ? 0 : -1; } else { order = array[i].CompareTo(value); } if (o 阅读全文
posted @ 2011-03-08 16:19 dragonpig 阅读(313) 评论(0) 推荐(0) 编辑