Sorting algorithms/Insertion sort: Difference between revisions

Content added Content deleted
Line 861: Line 861:


Using some built-in algorithms (warning: not stable, due to the lack of an "upper bound" binary search function)
Using some built-in algorithms (warning: not stable, due to the lack of an "upper bound" binary search function)
{{trans|C++}}
<lang java5>public static <E extends Comparable<? super E>> void insertionSort(List<E> a) {
<lang java5>public static <E extends Comparable<? super E>> void insertionSort(List<E> a) {
for (int i = 1; i < a.size(); i++) {
for (int i = 1; i < a.size(); i++) {