- there are a lot of sort algorithms
- selection, bubble, insertion, quick, heap and merge sort ...
- use sort algorithm which has time complexity of O(NlgN)
- it's better to use sort in STL than making myself
- sort(begin, end)

- it sorts between begin and right before the end- function that sorts begin, end

- it is usually used for sorting before solving problems
- implementation code in C++

- boj.kr/2751
- sorting the number of N
- sort in Java (using built-in sort algorithm)

- boj.kr/11650
- solution in Java

- boj.kr/11651
- solution is almost the same as above one

- When there are some cards like this

- 7♠, 5♥, 2♥, 5♠

♦ ♣ - When cards are sorted in the order in which numbers are increasing

- how would be the order of 5♥ and 5♠

- it can be like

- 2♥, 5♥, 5♠, 7♠

- it retains the order of input (Stable)

- 2♥, 5♠, 5♥, 7♠

- it doesn't retain the order of input (Unstable)

- we couldn't expect what would be the first between heart and spade - An alignment algorithm that retains the order before sorting when there is the same thing is called a Stable Sorting algorithm.
- Stable Sort Algorithm

- Merge Sort- STL stable_sort

- boj.kr/10814
- code in Java

- java doesn't have basic stable sort. so i just added order to class
- in C++, we can use tuple and make this with only one line of code

- sort but more complicated conditions
- code in java