Consider the vertical line passing through the middle point calculate the smallest distance dl on left of middle point and dr on right side
float dl = closestUtil ( P , mid ) ; float dr = closestUtil ( P + mid , n - mid ) ;