import java.util.Random; /** * A set of untility functions and a base class that every sorter must extend. * @author gtowell * created: April 15, 2020 */ public abstract class SortBase { /** a random number generator */ Random random; /** * Default constructor */ public SortBase() { this(445); } /** * Constructor with a seed for the random number generator. * @param seed */ public SortBase(int seed) { random=new Random(seed); } /** * Return aan array of size istem containing values 0..(size-1) * in random order. Uses the Fisher-Yates shuffle algorithm * @param size -- the size of the array * @return a shuffled array */ public int[] fyShuffle(int size) { int[] rtn = orderedArray(size); for (int i=0; i