摘要: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 阅读 (194) 评论 (0) 编辑