The fact that suffix trees/suffix arrays can be built in O(n) is IMO the most surprising and "magical" result in computer science. To me, more surprising than median of medians/quick select.
There might be more "magical"/surprising things that are obscure and I am unaware of, but to me, this is it. :)
There might be more "magical"/surprising things that are obscure and I am unaware of, but to me, this is it. :)