Homework 7 (Sort Detective) FAQ

Q: What are some good resources or examples I can look at to get started on this program?
A: Look at the lecture slides and the Sorting.java example from lecture. If you want to read more about implementing sorting algorithms, see Chapter 7 of the Weiss textbook.
Q: How can I run the SortDetective.jar program?
A: On some operating systems, you should be able to just double-click it and it will run. So try that first. If that does not work, the next way is to open the Terminal (Mac/Linux) or Command Prompt (Windows) and type:
java -jar SortDetective.jar

The above command only works if the Terminal's "current directory" is the same as the directory where you saved SortDetective.jar. If not, you might need to supply a full path to the .jar file on your hard drive, like the following examples:

java -jar /Users/jsmith/Downloads/SortDetective.jar

java -jar C:\Users\suzie\Documents\cse373\hw7\SortDetective.jar


If you are on Windows and double-clicking the JAR does not run it, but you are unable to use the Terminal as described, you can instead try this .bat file. Right-click the .bat link below and choose Save As... to download it to the same folder as your SortDetective.jar. Then double-click the .bat file to run it. (Make sure you save the file with the right file name with .bat extension, not .txt.)

Q: On Part B, why do I get a StackOverflowError when I run my quick sort with arrays over a certain size?
A: A stack overflow is when you have too many recursive calls waiting for each other. That happens if the quick sort chooses the pivot poorly, which will happen if you run it on an ascending or descending array and have not implemented the median-of-3 pivot system yet.
This document and its content are copyright © Marty Stepp, 2013. All rights reserved.
Any redistribution, reproduction, transmission, or storage of part or all of the contents in any form
is prohibited without the author's expressed written permission.