Question
** Please help me out, I'm trying to study for my final and this question is a practice example to prepare myself for the final **
Suppose we have an array, arr, of arr length values that we want to sort into increasing order Furthermore, we know that all the values are in the range 0..max, inclusive. One method to sort them is called bucket sort. In a bucket sort, we will use an auxiliary array, counts, to keep track of the number of occurrences of each integer from arr he elements in counts are the buckets": there will be max+ 1 such buckets.) We sort by first filling the counts array, and then finish sorting arr by using the data in counts. (Note: this is an example of a non comparison sort.) Part A Implement bucket sort in the Java method bsort, below. Here's an example of possible input and results: 5 max F arr before call arr after sort (arr 5) 12, 0, 5, 2, 4, 5, 0, 21 [0, 0, 2, 2, 2, 4, 5 5 sorts the arr length values in arr into increasing order. PRE all the values in arr are between 0 and max, inclusive, and max static public void bsort (int arr, int max) Part B What's the big-O worst-case time for the bucket sort algorithm? Part C y is bucket sort not useful as a general-purpose sorting algorithm? (Keep your answer to a few sentences: there's only a lot of space here because of page formatting.
Explanation / Answer
it print 1->2->3->1->2->3->1->2->3-> and so on. its a circular Link list