Display Inversions pairs in array

Basically there are two conditions of inversion pairs in collection of integer array. Such as (i < j) where i and j is index position. And element array[i] is greater than array[j] (array[i] > array[j]).

For example
array [] = {1 , 7 , 6 , 4 , 5 , 9 , 8}

Output
(7,6)
(7,4)
(7,5)
(6,4)
(6,5)
(9,8) 



Comment

Please share your knowledge to improve code and content standard. Also submit your doubts, and test case. We improve by your feedback. We will try to resolve your query as soon as possible.

New Comment







© 2022, kalkicode.com, All rights reserved