Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- private static ArrayList<HighScore> highScores = new ArrayList<HighScore>();
- quickSort(highScores,First,Last);
- private static void quickSort(ArrayList<HighScore> highScores2, int first, int last){
- if(first < last)
- {
- PivotValue = highScores2.get(first).getScore();
- LeftPointer = first + 1;
- RightPointer = last;
- while((LeftPointer <= RightPointer))
- {
- while((LeftPointer <= RightPointer)&&(highScores2.get(LeftPointer).getScore() < PivotValue))
- {
- LeftPointer++;
- }
- while((highScores2.get(RightPointer).getScore() > PivotValue)&&(LeftPointer <= RightPointer))
- {
- RightPointer--;
- }
- if(LeftPointer < RightPointer)
- {
- HighScore temp = highScores2.get(LeftPointer);
- highScores2.set(RightPointer, highScores2.get(LeftPointer));
- temp.equals(highScores2.get(RightPointer));
- }
- }
- Pivot = RightPointer;
- HighScore temp = highScores2.get(first);
- highScores2.set(Pivot,highScores2.get(first));
- temp.equals(highScores2.get(Pivot));
- quickSort(highScores2, first, Pivot-1);
- quickSort(highScores2, Pivot + 1, last);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement