We present new algorithms for computing the exact distributions and p-values of quadratic t-sample distribution-free statistics of Kruskal-Wallis type. These algorithms are presented in terms of generating functions. We show that our algorithm also works for cases with ties and that it is much faster than existing algorithms. Moreover, we show how to use the results for the Kruskal-Wallis type statistics to compute the exact null distribution of the Chacko-Shorack statistic. © 2003 Elsevier B.V. All rights reserved.