public static class BinarySearchHelper { public static int BinarySearch(int[] items, int find) { int start = 0; int end = items.Length - 1; return RecursiveFind(items, find, start, end); } private static int RecursiveFind(int[] items, int find, int start, int end) { int chunkSize = 1 + (end - start); if (chunkSize == 0) return -1; int midpoint = start + (chunkSize / 2); if (items[midpoint] == find) return midpoint; else if (items[midpoint] > find) return RecursiveFind(items, find, start, midpoint - 1); else return RecursiveFind(items, find, midpoint + 1, end); } }