Skip to content

Commit 483077c

Browse files
authored
Update README.md
1 parent 7e51205 commit 483077c

File tree

1 file changed

+13
-119
lines changed

1 file changed

+13
-119
lines changed

SortingAlgorithm/Java/README.md

Lines changed: 13 additions & 119 deletions
Original file line numberDiff line numberDiff line change
@@ -1,143 +1,37 @@
1-
Project
2-
-----------
3-
<br/>
41

5-
#### Java
62

7-
8-
9-
10-
> - Java로 구현 한 정렬 알고리즘 폴더들이 있습니다.
11-
> - Java11 API : [Java API](https://docs.oracle.com/en/java/javase/11/docs/api/index.html)
12-
> - 특별한 경우를 제외하고는 사용자 객체의 정렬까지 지원합니다.
13-
> - 사용자 객체(클래스)를 정렬하는 경우 Comparator 또는 Comparable에 의해 비교방식을 구현해주어야 하며, 형식은 표준 Java 작성법과 동일합니다.
14-
15-
</br></br>
16-
#### [Preview subFolder]
17-
> - SelectionSort : Selection sort(선택 정렬)를 구현한 소스코드가 있습니다.
18-
> - InsertionSort : Insertion sort(삽입 정렬)를 구현한 소스코드가 있습니다.
19-
> - BubbleSort : Bubble sort(거품 정렬)을 구현한 소스코드가 있습니다.
20-
> - ShellSort : Shell sort(셸 정렬)을 구현한 소스코드가 있습니다.
21-
> - HeapSort : Heap sort(힙 정렬)을 구현한 소스코드가 있습니다.
22-
> - MergeSort : Merge sort(합병/병합 정렬)을 구현한 소스코드가 있습니다.
23-
> - QuickSort : Quick sort(퀵 정렬)을 구현한 소스코드가 있습니다.
24-
25-
26-
27-
<br/><br/>
28-
&nbsp;&nbsp;&nbsp; 블로그에서 포스팅과 동시에 지속적으로 업데이트 예정
29-
30-
31-
<br/><br/>
32-
<br/><br/>
33-
34-
-----------------
35-
36-
37-
#### How to Use (download ZIP) on Eclipse
38-
<br/>
39-
40-
- **1. Project import** <br /> <br /> Window -> File -> New -> Java Project -> uncheck the **"Use default location"** and Browse the **SortingAlgorithm** folder
41-
-> Finish
42-
43-
<br /><br />
44-
45-
- **2. Build path** <br /> <br /> Your Project -> Build Path -> Configure Build Path -> Project -> select the class path -> add -> Select **SortingAlgorithm** -> Apply and Close
46-
47-
<br /><br />
48-
49-
- **3. import class**
50-
51-
```
52-
import [sorting algorithm package name].[sorting algorithm name];
53-
```
3+
# NOTE
544

555
</br></br></br>
566

57-
**All sorting methods are static methods.**
58-
59-
```java
60-
//ex.
61-
62-
import BubbleSort.BubbleSort;
7+
## QuickSort
638

64-
class YourClass {
65-
public static void main {
66-
int[] a = {1, 5, 2, 4};
67-
BubbleSort.sort(a);
68-
}
69-
}
70-
```
9+
</br>
7110

72-
</br></br></br>
73-
74-
**If you want to sort an array of primitive types in reverse order, use it as in the following example.**
11+
Quick sort has 3 types based on pivot selection.
7512

76-
```java
77-
//ex.
7813

79-
import BubbleSort.BubbleSort;
80-
81-
class YourClass {
82-
public static void main {
83-
int[] a = {1, 5, 2, 4};
84-
// true : reverse order, false : nature order
85-
BubbleSort.sort(a, true);
86-
}
87-
}
88-
```
14+
> - QuickSort : implemented with middle element selected as the pivot (standard)
15+
> - LPQuickSort : implemented with left element selected as the pivot
16+
> - RPQuickSort : implmemented with right element selected as the pivot
8917
9018
</br></br></br>
9119

20+
## ParallelSort
9221

93-
**If you want to sort an array of Wrapper types in reverse order, use it as in the following example.**
94-
22+
</br>
9523

96-
```java
97-
//ex.
24+
Sorting algorithm in this package uses **threading**.
9825

99-
import BubbleSort.BubbleSort;
100-
import Utils.Order;
10126

102-
class YourClass {
103-
public static void main {
104-
Integer[] a = {1, 5, 2, 4};
105-
BubbleSort.sort(a, Order.reverseOrder());
106-
// or Collections.reverseOrder() (in java.util package)
107-
}
108-
}
109-
```
110-
<br/>
111-
112-
```
113-
Note : reverseOrder() method is in Utils.Order.
114-
```
115-
116-
</br></br></br>
117-
<br/>
118-
119-
```
120-
Note
121-
122-
class QuickSort -> standard QuickSort (with middle element selected as pivot)
123-
class LPQuickSort -> left-pivot QuickSort
124-
class RPQuickSort -> right-pivot QuickSort
125-
```
126-
127-
</br></br></br>
27+
> - ParallelLPQuickSort (left pivot quick sort with threading)
12828
29+
</br>
12930

130-
<br/><br/>
31+
`to be updated..`
13132

132-
-----------------
13333

134-
#### 구현 대한 내용은 블로그에 기재하고 있습니다.
135-
<br/>
13634

137-
- [Stranger's LAB](https://st-lab.tistory.com/category/알고리즘/Java)
138-
<br/>
139-
&nbsp;&nbsp;&nbsp; 부분적으로 추가 구현 또는 차이가 있을 수 있습니다.
14035

141-
<br/><br/>
14236

14337

0 commit comments

Comments
 (0)