bucket-sort Questions

3

For a current OpenCL GPGPU project, I need to sort elements in an array according to some key with 64 possible values. I need the final array to have all elemens with the same key to be contiguous....
Stock asked 27/5, 2013 at 23:57

5

Solved

I just read the Wikipedia page about Bucket sort. In this article they say that the worst case complexity is O(n²). But I thought the worst case complexity was O(n + k) where k are the number of bu...
Twentieth asked 20/3, 2012 at 17:42

2

Solved

This comment suggests that there is a O(n) alternative to my O(n log n) solution to this problem: Given string str("helloWorld") the expected output is: l = 3 o = 2 My solution was to do th...
Wang asked 2/1, 2018 at 16:8

2

Bucket sort is a linear-time sort. Why do we use insertion sort in it? We know that insertion sort takes O(n2) time. Why can we not use any linear sort inside it? As we see, when in each bucket we...
Hidie asked 29/10, 2015 at 2:51

1

Solved

When is bucket sort algorithm the best method to use for sorting? Is there a recommended guide in using them based on the size, type of data structure?
Annmarieannnora asked 26/7, 2015 at 3:36

6

I am completely stumped on a problem and would like some guidance. I am picking random sets of 8 numbers from the set of 1 to 8 (for example, 5,6,8,1,3,4,2,7) and trying to bucket those numbers as ...
Gaut asked 16/7, 2015 at 18:0

1

Solved

Let A1,A2,...,An be real numbers between [0,2k] (k is constant). It's known that for any pair of Ai,AJ then |Ai-Aj|>=k/n, Describe an algorithm sorting the numbers in O(n) runtime worst-case. ...
Wenda asked 4/7, 2013 at 18:45

1

Solved

I am exploring the following algorithms: Counting Sort Radix Sort Bucket Sort I know all three are capable of running in linear time at best case, but I am having trouble with understanding whe...
Vixen asked 2/4, 2013 at 3:42

7

Solved

I am reading the definitions of radix, counting and bucket sorts and it seems that all of them are just the code below: public static void sort(int[] a, int maxVal){ int [] bucket=new int[maxVal+...
Centrifuge asked 16/1, 2013 at 21:41

1

Solved

I am trying to implement American Bucket Sort. Wiki says "first to count the number of objects that will fall in each bin, and second to place each object in its bucket." In second phase, when pla...
Anallese asked 24/11, 2011 at 21:50
1

© 2022 - 2024 — McMap. All rights reserved.