Programming Resources
For Fun and Learning
Charles Cusack
Computer Science
Hope College
main

Python
C++

JAVA


PHP
SQL
Assignments

ParellelSorts


ParallelQuickSort_MINE.java

package sorts;

public class ParallelQuickSort_MINE extends GenericSortAlgorithm {
    
    // Threshold for switching to sequential quicksort (tune as needed)
    private static final int THRESHOLD = 5000;

	public ParallelQuickSort_MINE() {
	}
    public ParallelQuickSort_MINE(int[] array, int left, int right) {
        super(array, left, right);
    }

	@Override
	public String getName() {
		return "PQS Mine";
	}

    @Override
    protected void compute() {
    	// TODO #2
    	// Implement the naive parallel version of quicksort
    	// Make sure to use a reasonable sequential cutoff (THRESHOLD)
    	// Change the THRESHOLD value to experiment with performance
    	// You will most certainly need to create additional methods.
    	// You may use the methods from GenericSortAlgorithm as well, 
    	// but for the best performance, you may need to implement
    	// your own versions of those methods. (Since this subclasses
    	// GenericSortAlgorithm, you have access to all its methods, including
    	// the generic sorting algorithms.)
    	
    	// Remember to use fork/join as appropriate.
    	// You can also use invokeAll() to fork multiple tasks.
    }
}