Practice Real Company Assessment Patterns • Latest 2025–2026 Mock Tests

Programming Exercises

Write a function to perform bucket sort on an array

Hard

Problem 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 } }
Log in or sign up to run or submit your code.Log inSign up
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]