GeezerVisonThe World Wide Web, restored to 800 pixels of glory. |
| Home|About|Gaming cabinet|Archives|How it works|Starter sites |
GeezerVison is showing github.com — Java/Sorts/SortAlgorithm.java at master · feinoah/Java Expand file tree/ Copy pathSortAlgorithm.javaMore file actions 31 lines (26 loc) · 805 Bytes / Copy pathSortAlgorithm.javaFile metadata and controls31 lines (26 loc) · 805 Bytes 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 package Sorts; import java.util.Arrays; import java.util.List; /** * The common interface of most sorting algorithms * * @author Podshivalov Nikita (https://github.com/nikitap492) * **/ public interface SortAlgorithm { /** * Main method arrays sorting algorithms * @param unsorted - an array should be sorted * @return a sorted array */ <T extends Comparable<T>> T[] sort(T[] unsorted); /** * Auxiliary method for algorithms what wanted to work with lists from JCF * @param unsorted - a list should be sorted * @return a sorted list */ @SuppressWarnings("unchecked") default <T extends Comparable<T>> List<T> sort(List<T> unsorted){ return Arrays.asList(sort(unsorted.toArray((T[]) new Comparable[unsorted.size()]))); } } |
| You are visitor 01402520 — GeezerVison does not store the pages you look up. Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required. |