private static int rank_iterative(int[] N, int key) {

		int lo = 0;
		int hi = N.length - 1;

		while (lo <= hi) {
			int mid = findMidpoint(hi, lo); // find the midpoint
			
			if (key < N[mid]) { // the key is in the lower half so lower the upper bound
				hi = --mid;
			} else if (key > N[mid]) { // the key is in the upper half so raise the lower bound
				lo = ++mid;
			} else {
				return mid;
			}
		}
		
		return KEY_NOT_FOUND;
	}