This implementation includes the optimizations described in chapterĀ 6.4.2 to improve the internal cost the the sort.