private static long med3(
      final int[][] x, final long a, final long b, final long c, IntComparator comp) {
    int ab = comp.compare(get(x, a), get(x, b));
    int ac = comp.compare(get(x, a), get(x, c));
    int bc = comp.compare(get(x, b), get(x, c));
    return (ab < 0 ? (bc < 0 ? b : ac < 0 ? c : a) : (bc > 0 ? b : ac > 0 ? c : a));
  }
Sorts the specified range of elements according to the order induced by the specified
comparator using quicksort.

<p>

<p>The sorting algorithm is a tuned quicksort adapted from Jon L. Bentley and M. Douglas
McIlroy, &ldquo;Engineering a Sort Function&rdquo;, <i>Software: Practice and Experience</i>,
23(11), pages 1249&minus;1265, 1993.

@param x the big array to be sorted.
@param from the index of the first element (inclusive) to be sorted.
@param to the index of the last element (exclusive) to be sorted.
@param comp the comparator to determine the sorting order.
iotdb-core/datanode/src/main/java/org/apache/iotdb/db/queryengine/execution/operator/source/relational/aggregation/grouped/array/IntBigArrays.java