To me, the answer to this is easy, to wit:
by acknowledged genius and much-honored professor (now retired I believe),
Donald E. Knuth. Note the name of the work (not complete in the URL above) is:
"The Art of Computer Programming"
OTOH, do *not* expect an easy time reading this book —- It is 4 volumes (so far), of a projected 7 volumes, I believe.
When Bill Gates was president and CEO of Microsoft, he said that anyone who read this book, and understood it, should definitely send him a resume. It is (for me anyway) a life’s work just to read this book, and do some reasonable subset of the exercises at the end of each chapter. I am still engaged in that activity, (off and on)…