In some cases the organization of the data set helps. Look here: https://www.researchgate.net/publication/5606737_A_finite-element_mesh_generator_based_on_growing_neural_networks
Article A finite-element mesh generator based on growing neural networks
in worst case, the best sorting algorithms are of order n log2 n. According to Press et al. (2007), two of the best algorithms are Quicksort and Heapsort. Both are of order n log2 n even for the best case. Quicksort is of order n2 for the worst case.
References:
W. H. Press, S. A. Teukolsky, W. T. Vetterling, B. P. Flannery. Numerical Recipes: The Art of Scientific Computing, 3rd ed., Cambridge University Press, 2007
D. E. Knuth. The Art of Computer Programming, vol 3, 2nd ed., Addison-Wesley, Reading, 1998