## Diff sort

Posted on: February 27th, 2014 by
1

You are given an array of n real numbers. Arrange them so that the average difference between adjacent numbers is minimized. In other words, minimize ${1\over n-1}\sum_{i=1}^{n-1} |X[i]-X[j]|$.

- via Algorithmic puzzles