c - what is the problem with below sorting algorithm can you optimize this include stdioh int arr10 122301172390247 int mainvoid sort10 forint i0 i10 i printfd arri return 0 void sortint size forint isize i1 i int k maxi int temp arrk arrk arri1 arri1 - skillgun

There is no problem with this sorting algorithm. if you want optimization then go for merge sort.

the problem with this sorting algorithm, in the worst case if the array is already in sorted order, then unnecessarily we are looping through the array for (n-1)n/2 times. To optimize this, we can put a check in max() function, if all elements are in sorted order, then maintaining one boolean flag so that outer for loop will keep checking that flag to stop iterating.

the problem with this sorting algorithm, in the worst case if the array is already in sorted order, then unnecessarily we are looping through the array for (n-1)n/2 times. To optimize this, we better use merge sort algorithm it takes only O(n log n) iterations to sort the array elements.

the problem with this sorting algorithm, in the worst case if the array is already in sorted order, then unnecessarily we are looping through the array for (n-1)n/2 times. To optimize this, we can put a check in sort() function, if all elements are in sorted order, then maintaining one boolean flag so that outer for loop will keep checking that flag to stop iterating.

Answer :(B)

the problem with this sorting algorithm, in the worst case if the array is already in sorted order, then unnecessarily we are looping through the array for (n-1)n/2 times. To optimize this, we can put a check in max() function, if all elements are in sorted order, then maintaining one boolean flag so that outer for loop will keep checking that flag to stop iterating.

Description :

the problem with this sorting algorithm, in the worst case if the array is already in sorted order, then unnecessarily we are looping through the array for (n-1)n/2 times. To optimize this, we can put a check in max() function, if all elements are in sorted order, then maintaining one boolean flag so that outer for loop will keep checking that flat to stop iterating.