Sort Algorithm Algorithm

Further, the input data is often stored in an array, which lets random access, rather than a list, which only lets sequential access; though many algorithms can be apply to either type of data after suitable modification. In computer science, a sorting algorithm is an algorithm that puts components of a list in a certain order. 

Sorting algorithms are prevalent in introductory computer science classes, where the abundance of algorithms for the problem provides a gentle introduction to a variety of core algorithm concepts, such as large O notation, divide and conquer algorithms, data structures such as heaps and binary trees, randomized algorithms, best, worst and averageAsymptotically optimal algorithms have been known since the mid-20th century — useful new algorithms are still being invented, with the now widely used Timsort dating to 2002, and the library sort being first published in 2006.Among the writers of early sorting algorithms around 1951 was Betty Holberton (née Snyder), who worked on ENIAC and UNIVAC.
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()])));
    }

}

LANGUAGE:

DARK MODE: