private void doQuickSort() {
JOptionPane.showMessageDialog (null, "doing quicksort" );
if(arraydata.getText().equals("")){
JOptionPane.showMessageDialog (null, "Please insert values to be sorted!" );
}else
{
//Use split method to put the String into String array separated with " " delimeter
String inputString = arraydata.getText();
String[] stringParts = inputString.split(" ");
//Convert String array to int array
int[] ints = new int[stringParts.length];
for (int i=0; i < stringParts.length; i++) {
ints[i] = Integer.parseInt(stringParts[i]);
}
//System.out.println(ints[2]);
//Pick a pivot (middle)
int temp = ints.length/2;
int pivot = ints[temp];
//System.out.println("pivot is: "+pivot);
//declaring the low and hi
int templow = ints[0]; //low
int temphi = ints[ints.length -1]; //high
while(templow <= temphi){
while(templow < pivot)
templow++;
while(temphi > pivot)
temphi--;
if(templow <= temphi){
}
}
}
}