Finding smallest circle enclosing all points given their $x,y$-coordinates?

Your algorithm is very simple because it doesn't always work.

Suppose we are given the points $(1,0)$, $(2,0)$, and $(6,0)$. Your algorithm will first average them to get the point $(3,0)$, then compute a maximum distance of $3$. However, a better solution is to take a circle with center $(3.5,0)$ and radius $2.5$.