Consider array A has 5 elements A[ ]={ 30, 28, 12 , 24, 8}. How many inversions are there in the array after the 2 passes using the selection sort algorithm?

Hint:

Inversion: Let array A[1...n] be an array of elements, If the two indexes i, j of the array. If iA[j] then the pair i,j is known as inversion of the array. 

1
4
2
3
3
2
4
1

Sponsored

hivanix.in

Visit

This quiz is brought to you by hivanix.in

🌐 Web App Development

Quick Navigation