rows
and cols
, to store the x and y coordinates of homes respectively.rows
and y-coordinate to cols
.rows
and cols
.rows
and cols
. If the number of elements is odd, the median is the middle element. If even, it can be any of the two middle elements.