Improved coder placement algorithm performance

Improved performance from Θ(n²) to O(nlogn)