code: private static int binarySearch(int[] a, int fromIndex, int length, int key)
      {
          int low = fromIndex;
          int high = fromIndex + length - 1;
  
          while (low <= high)
          {
              int mid = (low + high) >>> 1;
              int midVal = a[mid << 1];
  
              if (midVal < key)
                  low = mid + 1;
              else if (midVal > key)
                  high = mid - 1;
              else
                  return mid; // key found
          }
          return -(low + 1);  // key not found.
      }
docs: 二分搜索，由于二元接续前一个词固定时，后一个词比较少，所以二分也能取得很高的性能
  @param a 目标数组
  @param fromIndex 开始下标
  @param length 长度
  @param key 词的id
  @return 共现频次