File tree Expand file tree Collapse file tree 1 file changed +9
-2
lines changed Expand file tree Collapse file tree 1 file changed +9
-2
lines changed Original file line number Diff line number Diff line change 77#include < vector>
88namespace cp_algo {
99 template <size_t maxc>
10- void count_sort (auto &a, auto &&proj = std::identity{} ) {
10+ void count_sort (auto &a, auto &&proj) {
1111 std::array<int , maxc> cnt = {};
1212 for (auto &x: a) {
1313 cnt[proj (x)]++;
@@ -19,8 +19,12 @@ namespace cp_algo {
1919 }
2020 a = std::move (res);
2121 }
22+ template <size_t maxc>
23+ void count_sort (auto &a) {
24+ count_sort<maxc>(a, std::identity{});
25+ }
2226
23- void radix_sort (auto &a, auto &&proj = std::identity{} ) {
27+ void radix_sort (auto &a, auto &&proj) {
2428 if (empty (a)) {
2529 return ;
2630 }
@@ -34,5 +38,8 @@ namespace cp_algo {
3438 }
3539 });
3640 }
41+ void radix_sort (auto &a) {
42+ radix_sort (a, std::identity{});
43+ }
3744}
3845#endif // CP_ALGO_UTIL_SORT_HPP
You can’t perform that action at this time.
0 commit comments