It depends on how the records are stored. If you save each entry in a cell in a linked list, you can sort them in the form of a bucket with a constant amount of memory by simply moving items from the original list and into buckets. This will require you to use pointers and recode pointers, but it is not as complicated as it seems. You simply spliced โโcells from the main list and into buckets for sorting.
One question is, is there a reason why you want to use bucket sort to sort names? You can sort the rows using basket sort, but for this you will almost certainly need more than two buckets; you will probably have one for each letter of the alphabet, and one for "there are no letters." If you have a linked list, you might consider exploring merge sorting as a possibility, as it is not too difficult to implement and has excellent run-time guarantees.
source share