/** * Sort the given range of items using quick sort. {@inheritDoc} If the recursion depth falls below * {@link #getMaxDepth}, then switch to {@link HeapSort}. */ public void sort(final IndexedSortable s, int p, int r) { int recordsPerSegment = s.recordsPerSegment(); int recordSize = s.recordSize(); int maxOffset = recordSize * (recordsPerSegment - 1); int pN = p / recordsPerSegment; int pO = (p % recordsPerSegment) * recordSize; int rN = r / recordsPerSegment; int rO = (r % recordsPerSegment) * recordSize; sortInternal(s, recordsPerSegment, recordSize, maxOffset, p, pN, pO, r, rN, rO, getMaxDepth(r - p)); }
/** * Sort the given range of items using quick sort. {@inheritDoc} If the recursion depth falls below * {@link #getMaxDepth}, then switch to {@link HeapSort}. */ public void sort(final IndexedSortable s, int p, int r) { int recordsPerSegment = s.recordsPerSegment(); int recordSize = s.recordSize(); int maxOffset = recordSize * (recordsPerSegment - 1); int pN = p / recordsPerSegment; int pO = (p % recordsPerSegment) * recordSize; int rN = r / recordsPerSegment; int rO = (r % recordsPerSegment) * recordSize; sortInternal(s, recordsPerSegment, recordSize, maxOffset, p, pN, pO, r, rN, rO, getMaxDepth(r - p)); }
/** * Sort the given range of items using quick sort. {@inheritDoc} If the recursion depth falls below * {@link #getMaxDepth}, then switch to {@link HeapSort}. */ public void sort(final IndexedSortable s, int p, int r) { int recordsPerSegment = s.recordsPerSegment(); int recordSize = s.recordSize(); int maxOffset = recordSize * (recordsPerSegment - 1); int pN = p / recordsPerSegment; int pO = (p % recordsPerSegment) * recordSize; int rN = r / recordsPerSegment; int rO = (r % recordsPerSegment) * recordSize; sortInternal(s, recordsPerSegment, recordSize, maxOffset, p, pN, pO, r, rN, rO, getMaxDepth(r - p)); }
/** * Sort the given range of items using quick sort. {@inheritDoc} If the recursion depth falls below * {@link #getMaxDepth}, then switch to {@link HeapSort}. */ public void sort(final IndexedSortable s, int p, int r) { int recordsPerSegment = s.recordsPerSegment(); int recordSize = s.recordSize(); int maxOffset = recordSize * (recordsPerSegment - 1); int pN = p / recordsPerSegment; int pO = (p % recordsPerSegment) * recordSize; int rN = r / recordsPerSegment; int rO = (r % recordsPerSegment) * recordSize; sortInternal(s, recordsPerSegment, recordSize, maxOffset, p, pN, pO, r, rN, rO, getMaxDepth(r - p)); }