Alas, it is wrong.
That isn't a bucket sort... you are actually trying to do something along the lines of a counting sort, only you aren't storing the number of items in the bucket either.
http://www.cplusplus.com/faq/sequences/sequencing/sort-algorithms/bucket-sort/
Remember, the following conditions apply for a bucket sort:
- there are fewer buckets than items
- a bucket may hold more than one item
- once everything is in a bucket, each bucket must be sorted
http://www.cplusplus.com/faq/sequences/sequencing/sort-algorithms/counting-sort/
And for an integer counting sort, a bucket holds:
- the integer value
- the number of times the integer value appears in the input
A counting sort is a kind of bucket sort, so if it makes no difference to your professor (or wherever you got the idea to do this), then I recommend you look at the counting sort, parts 1 and 2 in the link.
If it must be a bucket sort, then you need to redesign your algorithm.
Hope this helps.
Read the links