from typing import List


def quicksort(items: List[int]) -> List[int]:
    """Tony Hoare's algorithm.
    Returns a new list with sorted items.
    For an empty list it returns an empty list.

    >>> quicksort([1,8,3,5])
    [1, 3, 5, 8]
    >>> quicksort([6,4,9,3,2])
    [2, 3, 4, 6, 9]
    >>> quicksort([2,2,2,-3])
    [-3, 2, 2, 2]
    >>> quicksort([1])
    [1]
    >>> quicksort([])
    []
    """
    if not items:
        return []

    if len(items) == 1:
        return items
    else:
        anchor = items[0]
        lower_values = []
        higher_values = []
        equal_values = []
        for elem in items:
            if elem < anchor:
                lower_values.append(elem)
            elif elem > anchor:
                higher_values.append(elem)
            else:  # elem == anchor
                equal_values.append(elem)
        return quicksort(lower_values) + equal_values + quicksort(higher_values)