I/P : Input array[] = {4.0, 6.5, 34.0, 2.0, 56.0, 73.0, 5.0, -5.0, 22.0, 45.0, 52.0, 42.0, 421.0}
O/P: Sorted array[] = {-5.0, 2.0, 4.0, 5.0, 6.5, 22.0, 34.0, 42.0, 45.0, 52.0, 56.0, 73.0, 421.0}
Sorted array using bubble sort.
public class BubbleSort {
double[] getBubbleSort(double[] values) {
return new double[] {};
}
}
I have to maintain the given code structure.
It is simple but I don't understand, how will I return a new double array of sorted values?
Please give me a hint for this type of return statement.