Example 9 Let $S=\left(x_{1}, x_{2}, \cdots, x_{n}\right)$ be a permutation of the first $n$ natural numbers $1,2, \cdots, n$. $f(S)$ is the minimum value of the absolute differences between every two adjacent elements in $S$. Find the maximum value of $f(S)$.
(IMO - 30 Shortlist)
Solve by considering two cases.

(i) If $n=2k$ is even, then $f(S) \leqslant k$ and the absolute difference between it and its adjacent numbers is no more than $k$.

On the other hand, in $S=(k+1,1, k+2,2, \cdots, 2k, k)$, we have $f(S)=k=\left[\frac{n}{2}\right]$.
(ii) If $n=2k+1$ is odd, then $f(S) \leqslant k+1$ and the absolute difference between it and its adjacent numbers is no more than $k$.

On the other hand, in $S=(k+1,1, k+2,2, \cdots, 2k, k, 2k+1)$, we have
$$
f(S)=k=\left[\frac{n}{2}\right] \text {. }
$$

In summary, $\max f(S)=\left[\frac{n}{2}\right]$.