ãœãŒãã¢ã«ãŽãªãºã 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