Sorting out Lipschitz function approximation