MCPcopy Create free account
hub / github.com/Seogeurim/CS-study / quickSort

Method quickSort

contents/algorithm/code/QuickSort.java:5–12  ·  view source on GitHub ↗
(int[] arr, int start, int end)

Source from the content-addressed store, hash-verified

3public class QuickSort {
4
5 static void quickSort(int[] arr, int start, int end) {
6 if (start < end) { // 배열의 크기가 충분히 작아 질 때 까지 나눔
7 int p = partition(arr, start, end); // 파티션을 적용 했을 때 피봇의 인덱스를 구함
8
9 quickSort(arr, start, p - 1); // 처음 부터 피봇 전,
10 quickSort(arr, p + 1, end); // 피봇 후 부터 마지막 까지 다시 퀵소트를 함
11 }
12 }
13
14 static int partition(int[] arr, int start, int end) {
15 int low = start + 1; // pivot을 맨 왼쪽 값으로 할것이기 때문에 그 다음 값부터 확인

Callers 1

mainMethod · 0.95

Calls 1

partitionMethod · 0.95

Tested by

no test coverage detected