Reusable Java library of general tools with minimal external dependencies.
For questions or support, please contact us:
Email: support@aoindustries.com
Phone: 1-800-519-9541
Phone: +1-251-607-9556
Web: https://www.aoindustries.com/contact
public final class QubbleSort extends Object
19 Feb 1996: Fixed to avoid infinite loop discoved by Paul Haberli. Misbehaviour expressed when the pivot element was not unique. -Jason Harrison 21 Jun 1996: Modified code based on comments from Paul Haeberli, and Peter Schweizer (Peter.Schweizer@mni.fh-giessen.de). Used Daeron Meyer's (daeron@geom.umn.edu) code for the new pivoting code. - Jason Harrison 09 Jan 1998: Another set of bug fixes by Thomas Everth (everth@wave.co.nz) and John Brzustowski (jbrzusto@gpu.srv.ualberta.ca).
Adapted from Jim Boritz' QubbleSortAlgorithm.
| Modifier and Type | Method and Description |
|---|---|
protected static <T> int |
compare(List<T> list,
int i,
int j,
Comparator<? super T> comparator,
SortStatistics stats) |
protected static <T> int |
compare(T[] array,
int i,
int j,
Comparator<? super T> comparator,
SortStatistics stats) |
protected static <T> int |
compare(T O1,
T O2,
Comparator<? super T> comparator,
SortStatistics stats) |
protected static <T> T |
get(List<T> list,
int i,
SortStatistics stats) |
protected static <T> T |
get(T[] array,
int i,
SortStatistics stats) |
static QubbleSort |
getInstance() |
boolean |
isStable()
Checks if this is a stable sort.
|
protected static <T> void |
set(List<T> list,
int i,
T O,
SortStatistics stats) |
protected static <T> void |
set(T[] array,
int i,
T O,
SortStatistics stats) |
<T extends E> |
sort(List<T> list) |
<T extends E> |
sort(List<T> list,
Comparator<? super T> comparator) |
<T> void |
sort(List<T> list,
Comparator<? super T> comparator,
SortStatistics stats) |
<T extends E> |
sort(List<T> list,
SortStatistics stats) |
<T extends E> |
sort(T[] array) |
<T extends E> |
sort(T[] array,
Comparator<? super T> comparator) |
<T> void |
sort(T[] array,
Comparator<? super T> comparator,
SortStatistics stats) |
<T extends E> |
sort(T[] array,
SortStatistics stats) |
protected static <T> void |
swap(List<T> list,
int i,
int j,
SortStatistics stats) |
protected static <T> void |
swap(T[] array,
int i,
int j,
SortStatistics stats) |
public static QubbleSort getInstance()
public <T> void sort(List<T> list, Comparator<? super T> comparator, SortStatistics stats)
sort in interface ComparisonSortAlgorithm<Object>public <T> void sort(T[] array,
Comparator<? super T> comparator,
SortStatistics stats)
sort in interface ComparisonSortAlgorithm<Object>public boolean isStable()
SortAlgorithmpublic <T extends E> void sort(List<T> list)
sort in interface SortAlgorithm<E>public <T extends E> void sort(T[] array)
sort in interface SortAlgorithm<E>public <T extends E> void sort(List<T> list, SortStatistics stats)
sort in interface SortAlgorithm<E>public <T extends E> void sort(T[] array,
SortStatistics stats)
sort in interface SortAlgorithm<E>public <T extends E> void sort(List<T> list, Comparator<? super T> comparator)
sort in interface ComparisonSortAlgorithm<E>public <T extends E> void sort(T[] array,
Comparator<? super T> comparator)
sort in interface ComparisonSortAlgorithm<E>protected static <T> int compare(List<T> list, int i, int j, Comparator<? super T> comparator, SortStatistics stats)
protected static <T> int compare(T[] array,
int i,
int j,
Comparator<? super T> comparator,
SortStatistics stats)
protected static <T> int compare(T O1,
T O2,
Comparator<? super T> comparator,
SortStatistics stats)
protected static <T> T get(List<T> list, int i, SortStatistics stats)
protected static <T> T get(T[] array,
int i,
SortStatistics stats)
protected static <T> void set(List<T> list, int i, T O, SortStatistics stats)
protected static <T> void set(T[] array,
int i,
T O,
SortStatistics stats)
protected static <T> void swap(List<T> list, int i, int j, SortStatistics stats)
protected static <T> void swap(T[] array,
int i,
int j,
SortStatistics stats)
Copyright © 2000–2016 AO Industries, Inc.. All rights reserved.