c++ - How to use bucket sort to sort a set of strings -
i have set of strings set s
= {string1, string2 ... upto n }
. need sort them lexicographically.
how use bucket sort ?
also tell other efficient method can used solve question.
sort first character. gives number of "buckets." sort each nonempty bucket starting second character. repeat until whole thing sorted.
Comments
Post a Comment