Package algs21
Class Insertion
java.lang.Object
algs21.Insertion
-
Field Summary
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionprivate static void
exch
(int[] a, int i, int j) private static <T> void
exch
(T[] a, int i, int j) static <T extends Comparable<? super T>>
int[]indexSort
(T[] a) private static <T extends Comparable<? super T>>
booleanisSorted
(T[] a) private static <T extends Comparable<? super T>>
booleanisSorted
(T[] a, int lo, int hi) private static <T> boolean
isSorted
(T[] a, Comparator<? super T> c) private static <T> boolean
isSorted
(T[] a, Comparator<? super T> c, int lo, int hi) private static <T> boolean
less
(Comparator<? super T> c, T v, T w) private static <T extends Comparable<? super T>>
booleanless
(T v, T w) static void
private static <T> void
show
(T[] a) static <T extends Comparable<? super T>>
voidsort
(T[] a) static <T> void
sort
(T[] a, Comparator<? super T> c)
-
Field Details
-
COUNT_OPS
-
-
Constructor Details
-
Insertion
public Insertion()
-
-
Method Details
-
sort
-
sort
-
indexSort
-
less
-
exch
-
less
-
exch
-
isSorted
-
isSorted
-
isSorted
-
isSorted
-
show
-
main
-