Sort and Search. Geek alert, there's programming stuff here. Sorry.

I was (am??) an IBM mainframe assembler programmer for 50 years. And liked it.
However, I gotta admit, html is light years easier and faster.
In the early '70s, my boss was looking for a character string, maybe his name, in a file.
He wrote a COBOL program to read a file, and search for the character string.
But the search he coded was SLOW, so I told him I could do it better, and faster, and I did.

What you do initially, is find the least frequently used character in the string.
Then you scan each record, looking for that character. After finding it, then you do the compare.
IBM has an instruction that allows you to look for any of several different characters, in a record, all at the same time.
So you can search for multiple strings, all at the same time. (It is pretty cool.)

A few years later, The Bank, leased FILEAID, which wasn't faster, but was much better.
Many years after that, IBM included that function in ISPF (kind of like html from your desk).
I like that idea of finding strings, and have coded a couple programs that are somewhat similar, with variations.
But I never finished the last one, that would have included all of the various functions.

Sort is another interesting process. Maybe first, we should divide sort into 2 major categories.

Sort in an existing table is what I'm doing. For several years, I worked 3 days a week, 12 hours a day.
(Yeah, tough life.) But that job provided me with lots of free time, and I coded many common routines.
One of those was sorting a table. There are many different sort algorithms, but I just used an easy one.
2-3 months ago, I thought I'd try to write one that's more efficient - essentially does fewer compares and swaps.
I wrote a program that compares 3 different algorithms: