Understanding bucket sort

tsume

The Pervy Sage
Joined
Apr 19, 2010
Messages
21,130
Reaction score
373
Location
In the vasts of the internet
I have a mild understanding of bucket sorting, though the problem I'm having now is how do I partition the data into different buckets when the bucket sizes are changing?
I've seen some code on the bucket sort but most seems to be hard coded on the bucket size and how to partition.
 
Excuse me for being dense, perhaps I am missing the point... What do you mean "when the bucket sizes are changing"? Seeing as you don't always know for sure how many of the initial elements will go into each bucket in the first place, don't you have to use an expandable data structure for each bucket anyway?
 
Excuse me for being dense, perhaps I am missing the point... What do you mean "when the bucket sizes are changing"? Seeing as you don't always know for sure how many of the initial elements will go into each bucket in the first place, don't you have to use an expandable data structure for each bucket anyway?

Sorry dude, I'm racking my brain with so much work I didn't notice my mistake.
I wanted to say "when the number of buckets are changing"
 
Huh...well that seems fairly interesting. What's the scenario you're working with?
Using a parallel technique to create a suffix array. I looked at a lot of stuff but came to the conclusion it would be best for me to spread the suffix's to an allocated bucket and sort it locally.
 
So the number of buckets are changing during runtime?

To be honest, I think I'm missing the point :(

Anyway, maybe this'll help with some inspiration http://code.google.com/p/libdivsufsort/

Thanks for the link, I'll give it a check.

The number of bucket are created during compiling according to the machines cores i.e. 2 cores = 2 buckets, 4 cores = 4 buckets. I'm just trying to figure out how to partition the data when the sizes are different from the last compilation on a different machine.
 
Top
Sign up to the MyBroadband newsletter
X