subject: Parallel and Distributed Computing
Which of the sorting algorithm can you use for the array: 45, 21, 18, 13, 46, 32, 11, 2.
Note: Here I am taking consideration that we have to sort the array in ascending order.
Best Case: if input array is already sorted in ascending order.
Worst Case: if input array is sorted in descending order.
Average Case: if input array is sorted Intermittent. like our question array
Here our input array will fall inside the average case. So we can use the Quick Sort algorithm, because the time of Quick Sort is O(n log n) in the best case, O(n log n) in the average case , and O(n^2) in the worst case. But because it has the best performance in the average case for most inputs, It is generally considered the “fastest” sorting algorithm.
Thanks if you need help plzz comment in the comment section.
Get Answers For Free
Most questions answered within 1 hours.