Write a function to perform bucket sort on an array
HardProblem Statement
Write a function to perform bucket sort on an array
Sample Input
[0.42, 0.32, 0.53, 0.25, 0.47, 0.51]
Sample Output
[0.25, 0.32, 0.42, 0.47, 0.51, 0.53]
Limits
Time: 2s · Memory: 256 MB
Code Editor
00:00
import java.util.*;
public class Main {
public static void bucketSort() {
double[] arr = {0.42, 0.32, 0.53, 0.25, 0.47, 0.51};
// Your code here
}
}
Input
[0.42, 0.32, 0.53, 0.25, 0.47, 0.51]
Expected Output
[0.25, 0.32, 0.42, 0.47, 0.51, 0.53]