Quick Sort
Quick Sort
class Main
arr[i] = arr[j];
arr[j] = temp;
// elements less than the pivot will be pushed to the left of `pIndex`
// elements more than the pivot will be pushed to the right of `pIndex`
swap(a, i, pIndex);
pIndex++;
}
return pIndex;
// Quicksort routine
// base condition
return;
{
int[] a = { 9, -3, 5, 2, 6, 8, -6, 1, 3 };
System.out.println(Arrays.toString(a));
}
/*
*/
package javaapplication8;
import java.util.*;
import java.io.*;
import java.nio.*;
while (in.hasNextLine()) {
System.out.println(line);
}*/
try
if (!arquivo.exists())
//escreve no arquivo
bw.newLine();
bw.close();
fw.close();
while (br.ready())
System.out.println(linha);
br.close();
fr.close();
ex.printStackTrace();
in.useDelimiter("[/n]");
int lineCount = 0;
while (in.hasNextLine())
line = in.nextLine().trim();
lineIn.useDelimiter("");
matrix[lineCount][i] = Integer.parseInt(lineIn.next());
lineIn.next();
lineCount++;
}
return matrix;
System.out.print(Mat1[i][j]);
System.out.print(" ");
System.out.println("");
}
package ordenacao_vetores;
import java.util.*;
i = began;
j = end-1;
while(i <= j)
i++;
j--;
if(i <= j)
aux = values[i];
values[i] = values[j];
values[j] = aux;
i++;
j--;
}
}
Quicksort(values, i, end);
Quicksort(array, 0, 10);
String nome;
nome = le.nextLine();
System.out.println(nome);