Questions tagged [bucket-sort]

Bucket sort is a generic variant of the pigeonhole sorting algorithm which works by splitting a list into "buckets" based on arbitrary boundaries, sorting the buckets, and recombining the buckets in order.

A Bucket Sort takes arbitrary boundaries, then iterates through the input array and places the elements into a new array (its "bucket") based on the boundaries. After this, the sub-arrays are sorted separately. Finally, the sub-arrays are merged in order. Note that the Bucket Sort is not capable of sorting an array on its own; it must either recursively call itself, and recognize when passed an array of length 0 or 1, or call a different algorithm, in order to sort the buckets.

Return to

98 questions
0
votes
1 answer

What's the quickest quicksort - League table for sorting algorithms?

I was trying to optimize my quicksort for performance. For 4M (1<<22) integer items (4 bytes each), it takes a parallel quicksort algorithm 0.5 (0.499703) second to sort on a system which can support 72 concurrent threads (72 cores). I'm interested…
user1147800
  • 237
  • 4
  • 12
-1
votes
2 answers

Efficient ways to retrieve a sorted list from bucket sort?

When the distribution of keys is sparse in bucket sort, there may be a lot of empty buckets. How could we retrieve the sorted list (i.e., achieve the concatenation operation) efficiently? We want to implement an bucket based priority queue, but the…
-1
votes
1 answer

Bucket Sort with a custom data structure

My program is tasked with sorting points on an x-y plane, given by the user, according to their distance from the origin using bucket sort. In the instance of having two points with the same distance, the point with the smallest x-coordinate would…
-1
votes
1 answer

segmentation fault 11 in C++ code

for my bucket sort, I don't know why the out put is segmentation fault: 11 when I try to print out sorted distance. It should be running well on win pc, but I try running it on mac, but i just get error. where am I wrong? using namespace std; void…
BengDai
  • 51
  • 3
  • 10
-1
votes
2 answers

Bucket sort with huge random numbers

I know Bucket sort is has a lot of examples everywhere, so I tried to implement this so it can take huge random numbers with no luck void Bucket_sort(int arr[], int max){ const int maxsize = max; int bucket_list = new int [maxsize+1]; …
user4302094
-2
votes
1 answer

MPI_ERR_RANK: invalid rank with cluster

I'm doing a project for a class and I have used the code for sequential Bucket sort from the internet and I'm trying to make it be a parallel version using OpenMPI. This code will be running on the cluster system. When I test it, it is giving me the…
kukiduwa
  • 1
  • 1
  • 2
-2
votes
1 answer

expected value in bucket sort when the probability is unequal

I need help to solve a problem related to bucket sort algorithm, where we have n numbers of input and n buckets. Example that I got from the book shows a problem where the probability of an item falls into a certain bucket is equal =   . Now, I…
mskeira
  • 25
  • 5
-2
votes
1 answer

How do I create ranking (descending) table in matlab based on inputs from two separate data tables?

I have four data sets (please bear with me here): 1st Table: List of 10 tickers (stock symbols) in one column in txt format in matlab. 2nd table: dates in numerical format in one column (10 days in double format). 3rd table: I have 10*10 data set…
Noob_1
  • 145
  • 3
  • 11
1 2 3 4 5 6
7