::public/알고리즘

정렬(Sort) 종류

해맑은욱 2019. 6. 18. 02:35

선택 정렬(Selection Sort)
O(n^2)

버블 정렬(Bubble Sort) - 실제론 잘 쓰이지 않음
O(n^2)

삽입 정렬(Insertion Sort)
O(n^2)

퀵 정렬(Quick Sort)
O(n log n) - average
O(n^2) - worst

병합 정렬(Merge Sort)
O(n log n)

힙 정렬(Heap Sort)
O(n log n)

기수 정렬(Radix Sort)
O(n)

계수 정렬(Counting Sort)
O(n)