in reply to how sort works

There is a series of definitive computer-science textbooks, written by Dr. Knuth, and one of the volumes is entitled, Sorting and Searching.   Although many of the pages are scribbled with mathematical formulations and other strange magick which is far beyond my ken, it is nevertheless true that “sorting and searching” are, and always have been, probably the most-studied types of algorithms in all of computer science (with the possible exception of data encryption).