Answer to Question #8014 in Java | JSP | JSF for JD
2) the average case
3) The best case
Merge sort has the
1) NlogN - the elements are taken alternately
2) NlogN - a
random array, which is not better or worse
3) NlogN - the array elements are
arranged so that at the confluence of sub-arrays are first written elements of
the first subarray and then the elements of the second subarray
bubble sort has the properties:
An N ^ 2 - array sorted in reverse order with
respect to the desired
2 N ^ 2 - a random array, which is not better or
3 N ^ 2 - the array is sorted according to specified criteria
In the best case, the optimization of H
Therefore it is quicker to judge
- it is impossible.
At great length arrays show a sort very well.
same sort on an array of small length is much longer than the usual bubble sort
Need a fast expert's response?Submit order
and get a quick answer at the best price
for any assignment or question with DETAILED EXPLANATIONS!