Computer Science, asked by akshay4565, 5 hours ago

How many swaps are required to sort the given array[ 7,2,4,1,6]?
for all elements of array
if array[i] > array[i+1]
swap(array[i], array[i+1])
end if
end for
[2 Marks]​

Answers

Answered by s3c1582tejas9014
3

Answer:

ok

Explanation:

The given array is arr = {1, 2, 4, 3}. Bubble sort is used to sort the array elements. How many iterations will be done to sort the array? Explanation: Even though the first two elements are already sorted, bubble sort needs 4 iterations to sort the given array.

Similar questions