Data structure and algorithm -- reverse pair in array

Responsive image
source