Tabnine Logo
BooleanArrays.quickSort
Code IndexAdd Tabnine to your IDE (free)

How to use
quickSort
method
in
it.unimi.dsi.fastutil.booleans.BooleanArrays

Best Java code snippets using it.unimi.dsi.fastutil.booleans.BooleanArrays.quickSort (Showing top 17 results out of 315)

origin: AliView/AliView

/** Sorts an array according to the order induced by the specified
  * comparator using quicksort. 
  * 
  * <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 array to be sorted.
  * @param comp the comparator to determine the sorting order.
  * 
  */
public static void quickSort( final boolean[] x, final BooleanComparator comp ) {
quickSort( x, 0, x.length, comp );
}
@SuppressWarnings("unchecked")
origin: AliView/AliView

/** Sorts an array according to the natural ascending order using quicksort.
  * 
  * <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 array to be sorted.
  * 
  */
public static void quickSort( final boolean[] x ) {
quickSort( x, 0, x.length );
}
/** Sorts the specified range of elements according to the natural ascending order using mergesort, using a given support array.
origin: it.unimi.dsi/fastutil

/**
 * Sorts an array according to the natural ascending order using quicksort.
 *
 * <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.
 *
 * <p>
 * Note that this implementation does not allocate any object, contrarily to the
 * implementation used to sort primitive types in {@link java.util.Arrays},
 * which switches to mergesort on large inputs.
 *
 * @param x
 *            the array to be sorted.
 *
 */
public static void quickSort(final boolean[] x) {
  quickSort(x, 0, x.length);
}
protected static class ForkJoinQuickSort extends RecursiveAction {
origin: it.unimi.dsi/fastutil

/**
 * Sorts an array according to the order induced by the specified comparator
 * using quicksort.
 *
 * <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.
 *
 * <p>
 * Note that this implementation does not allocate any object, contrarily to the
 * implementation used to sort primitive types in {@link java.util.Arrays},
 * which switches to mergesort on large inputs.
 *
 * @param x
 *            the array to be sorted.
 * @param comp
 *            the comparator to determine the sorting order.
 *
 */
public static void quickSort(final boolean[] x, final BooleanComparator comp) {
  quickSort(x, 0, x.length, comp);
}
protected static class ForkJoinQuickSortComp extends RecursiveAction {
origin: it.unimi.dsi/fastutil

/**
 * Sorts two arrays according to the natural lexicographical ascending order
 * using quicksort.
 *
 * <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.
 *
 * <p>
 * This method implements a <em>lexicographical</em> sorting of the arguments.
 * Pairs of elements in the same position in the two provided arrays will be
 * considered a single key, and permuted accordingly. In the end, either
 * {@code x[i] &lt; x[i + 1]} or <code>x[i]
 * == x[i + 1]</code> and {@code y[i] &le; y[i + 1]}.
 *
 * @param x
 *            the first array to be sorted.
 * @param y
 *            the second array to be sorted.
 */
public static void quickSort(final boolean[] x, final boolean[] y) {
  ensureSameLength(x, y);
  quickSort(x, y, 0, x.length);
}
protected static class ForkJoinQuickSort2 extends RecursiveAction {
origin: org.apache.giraph/giraph-core

@Override
public void sort() {
 BooleanArrays.quickSort(elements(), 0, size());
}
origin: it.unimi.dsi/fastutil

/**
 * Sorts the specified range of elements according to the natural ascending
 * order using a parallel quicksort.
 *
 * <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.
 *
 * <p>
 * This implementation uses a {@link ForkJoinPool} executor service with
 * {@link Runtime#availableProcessors()} parallel threads.
 *
 * @param x
 *            the 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.
 */
public static void parallelQuickSort(final boolean[] x, final int from, final int to) {
  if (to - from < PARALLEL_QUICKSORT_NO_FORK)
    quickSort(x, from, to);
  else {
    final ForkJoinPool pool = new ForkJoinPool(Runtime.getRuntime().availableProcessors());
    pool.invoke(new ForkJoinQuickSort(x, from, to));
    pool.shutdown();
  }
}
/**
origin: it.unimi.dsi/fastutil

  final BooleanComparator comp) {
if (to - from < PARALLEL_QUICKSORT_NO_FORK)
  quickSort(x, from, to, comp);
else {
  final ForkJoinPool pool = new ForkJoinPool(Runtime.getRuntime().availableProcessors());
origin: it.unimi.dsi/fastutil

  quickSort(x, y, from, to);
final ForkJoinPool pool = new ForkJoinPool(Runtime.getRuntime().availableProcessors());
pool.invoke(new ForkJoinQuickSort2(x, y, from, to));
origin: AliView/AliView

vecSwap( x, b, n - s, s );
if ( ( s = b - a ) > 1 ) quickSort( x, from, from + s );
if ( ( s = d - c ) > 1 ) quickSort( x, n - s, n );
origin: it.unimi.dsi/fastutil

  quickSort(x, from, from + s);
if ((s = d - c) > 1)
  quickSort(x, to - s, to);
origin: it.unimi.dsi/fastutil

  quickSort(x, from, from + s, comp);
if ((s = d - c) > 1)
  quickSort(x, to - s, to, comp);
origin: AliView/AliView

vecSwap( x, b, n - s, s );
if ( ( s = b - a ) > 1 ) quickSort( x, from, from + s, comp );
if ( ( s = d - c ) > 1 ) quickSort( x, n - s, n, comp );
origin: it.unimi.dsi/fastutil

  quickSort(x, y, from, from + s);
if ((s = d - c) > 1)
  quickSort(x, y, to - s, to);
origin: it.unimi.dsi/fastutil

final int len = to - from;
if (len < PARALLEL_QUICKSORT_NO_FORK) {
  quickSort(x, y, from, to);
  return;
origin: it.unimi.dsi/fastutil

final int len = to - from;
if (len < PARALLEL_QUICKSORT_NO_FORK) {
  quickSort(x, from, to);
  return;
origin: it.unimi.dsi/fastutil

final int len = to - from;
if (len < PARALLEL_QUICKSORT_NO_FORK) {
  quickSort(x, from, to, comp);
  return;
it.unimi.dsi.fastutil.booleansBooleanArraysquickSort

Javadoc

Sorts an array according to the natural ascending order using quicksort.

The sorting algorithm is a tuned quicksort adapted from Jon L. Bentley and M. Douglas McIlroy, “Engineering a Sort Function”, Software: Practice and Experience, 23(11), pages 1249−1265, 1993.

Popular methods of BooleanArrays

  • ensureCapacity
    Ensures that an array can contain the given number of entries, preserving just a part of the array.
  • ensureFromTo
    Ensures that a range given by its first (inclusive) and last (exclusive) elements fits an array. Thi
  • ensureOffsetLength
    Ensures that a range given by an offset and a length fits an array. This method may be used whenever
  • fill
    Fills the given array with the given value.
  • insertionSort
  • med3
  • mergeSort
    Sorts an array according to the order induced by the specified comparator using mergesort. This sort
  • selectionSort
  • swap
  • trim
    Trims the given array to the given length.
  • ensureSameLength
    Ensures that two arrays are of the same length.
  • equals
    Returns true if the two arrays are elementwise equal.
  • ensureSameLength,
  • equals,
  • forceCapacity,
  • grow,
  • insertionSortIndirect,
  • med3Indirect,
  • parallelQuickSort,
  • parallelQuickSortIndirect,
  • quickSortIndirect

Popular in Java

  • Parsing JSON documents to java classes using gson
  • getExternalFilesDir (Context)
  • getSupportFragmentManager (FragmentActivity)
  • orElseThrow (Optional)
    Return the contained value, if present, otherwise throw an exception to be created by the provided s
  • Kernel (java.awt.image)
  • EOFException (java.io)
    Thrown when a program encounters the end of a file or stream during an input operation.
  • Socket (java.net)
    Provides a client-side TCP socket.
  • ReentrantLock (java.util.concurrent.locks)
    A reentrant mutual exclusion Lock with the same basic behavior and semantics as the implicit monitor
  • Manifest (java.util.jar)
    The Manifest class is used to obtain attribute information for a JarFile and its entries.
  • Annotation (javassist.bytecode.annotation)
    The annotation structure.An instance of this class is returned bygetAnnotations() in AnnotationsAttr
  • Top plugins for WebStorm
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now