μ λ ¬ μκ³ λ¦¬μ¦Advanced
λ²ν· μ λ ¬
μμλ₯Ό μ¬λ¬ λ²ν·μ λΆλ°°νλ λΆν¬ κΈ°λ° μ λ ¬ μκ³ λ¦¬μ¦μ λλ€. κ° λ²ν·μ λ€λ₯Έ μ λ ¬ μκ³ λ¦¬μ¦μ μ¬μ©νμ¬ κ°λ³μ μΌλ‘ μ λ ¬λ©λλ€. μ λ ₯μ΄ λ²μμ κ±Έμ³ κ· μΌνκ² λΆν¬λμ΄ μμ λ κ°μ₯ μ μλν©λλ€. νκ· μκ° λ³΅μ‘λλ O(n+k)μ λλ€.
#sorting#distribution-sort#linear-time#non-comparison
Complexity Analysis
Time (Average)
O(n + k)Expected case performance
Space
O(n + k)Memory requirements
Time (Best)
O(n + k)Best case performance
Time (Worst)
O(nΒ²)Worst case performance
π CLRS Reference
Introduction to Algorithmsβ’Chapter 8β’Section 8.4
Input Array
Implementation