Ask HN: I'm looking for a good book on the fundamentals of CS

253 points by Karsteski ↗ HN
I'm at the beginning of my software dev career, and as I didn't go to school for anything related (B.Sc. Chemistry), I feel like I really would like to have the fundamentals of CS down. Doubly so as I would like to go into the field of VR, and right now I'm working on my own toy rendering engine, which I feel is really exposing my lack of knowledge...

Anyways, any suggestions welcome. Ideally it'd be more digestible than just a plain textbook but I'm open to anything. I imagine either way it'll be a tough but great read to work through :)

189 comments

[ 3.0 ms ] story [ 219 ms ] thread
Concrete Mathematics: A Foundation for Computer Science, by Ronald Graham, Donald Knuth, and Oren Patashnik.
Oh I know Donald Knuth from the Lex Fridman podcast. I am noting that it was written in 1994. Would any problems result from this?
It’s a fundamentals thing, you will have to practice it a lot before it clicks and becomes practical for you to use on a daily basis.

But it won’t help you land a job at a startup, for that you need to learn JavaScript or C++

No but it's a maths textbook more than anything else. Not really a starting point for the sort of thing you're describing.
(comment deleted)
Textbooks are the old way to learn, but sometimes old is gold.

Use videos for faster learning though. It’s pretty much learning on cruise mode.

Asking as an avid textbook fan -- what might be some videos that you especially like?
I find the opposite, I can pace myself with books, take notes in the margins, interact with the harder concepts, cruise through the easier ones. Answer the questions at the end of the book in-line, it feels much more interactive. Since I can physically visualize all the sections/chapters it's easier to skip around. Video is so linear and passive; I have to go at the pace of the video and it's harder move alinearly. Also I have much more stamina for reading than listening to audio, the words start to blur together after a while.
My chief problem with learning from videos is... videos progress at a linear rate, but I don't absorb concepts at a linear rate. And even when delivery_rate/absorption_rate is a constant, it's rarely 1. I often have to stop, reverse, flip pages back and forth to compare precedents with consequents -- none of which is feasible with video.

With books I can also stop and take notes or reflect on what I've learned. That's harder with video.

And of course fewer words are spoken on video than are written in a book with fewer concepts and fewer illustrations, and with more verbal miscues -- errors or omissions.

I also rely heavily on the index of a book to look up related topics and terms, as used by the author.

In subjects that are precise (like math or algorithms) I've found learning from books to be far superior to video.

That said, some videos are great, especially those that animate or visualize, like 3Blue1Brown and Khan Academy.

> Use videos for faster learning though.

I'm pretty sure I can read at twice the speed that an average video is spoken.

And more importantly I can pause to think, re-read a sentence I didn't grasp and pace myself. All of these are far more cumbersome to do with video.

There my be entirely valid reasons to prefer videos. But I strongly contest the claim that videos are faster.

I like videos for small topics as well, but I find reading much easier for hard to digest knowledge, personally
My favorite CS book is structure and interpretation of computer programs.

I used it for one of my college CS classes. The book was written to be a semester class and MIT even has various offerings of their version of the course recorded and available on YouTube.

The book is online and available for free.

https://mitpress.mit.edu/sites/default/files/sicp/full-text/...

I'm currently going through TAOCP[1]. So far, seems pretty good (although I found one mistake in an exercise).

Also, I can never recommend Computer Systems: A Programmer's Perspective[1] enough. (Also features a rare mistakes in an exercise or two, but that's detail.)

And for network protocols, Comer's Internetworking with TCP/IP[3] was just great (you only need volume 1). I've read Stevens' books on socket and IPC programming in Unix, but didn't like them, so I also stayed away from TCP/IP Illustrated, but others have different opinions.

[1]: <https://www-cs-faculty.stanford.edu/~knuth/taocp.html>

[2]: <https://www.csapp.cs.cmu.edu/>

[3]: <https://www.pearson.com/us/higher-education/program/Comer-In...>

God bless you. I tried reading the AOCP books and it's hard... and I have a degree in CS
I found them extremely accessible, and I was a high-school dropout. (Admittedly a very late dropout, but a dropout nonetheless.) That was back when volume 4 didn't even exist as listicles yet. And, let's face it, the sheer size (and cost) of the thing, even then, was a bit intimidating, but there's nothing in it that can't be followed with a bit of algebra and the barest hint of what the kids these days call "pre-calculus". While it may be a bit of a slog to listen to Knuth, his writing is about as clear as it ever gets, things are laid out in a clear progression, and nothing jumps out at you suddenly without a clear buildup and foundation.
Concrete Mathematics, which isn't the easiest but also not the hardest math textbook, developed out of a course teaching the math from Chapter 1 of TAOCP. For people who find the first chapter, in particular, intimidating because of the math portions, it may be a good option to study before resuming TAOCP rather than just dropping TAOCP.
+1 for Concrete Mathematics. Learning more about discrete math had an immediate impact on my job as a data scientist.
And he is a funny writer. I didnt do the homeworks but found it surprisingly accessible

IronicaLly, I put off reading Seminumerical Algorothms for years because didnt understand it was numerical algorithms for computers without reals. The random number chapter alone is so awesome.

Oh, that's what it is? Ahh!!
I’m 27 years out of Uni and it’s great to see Comer's book still being used and recommended, and updated of course.
> although I found one mistake in an exercise

Check on Knuth's website to see if it's already been corrected. If not, you could get a prestigious Knuth reward cheque for finding an error.

If you mail Don Knuth about the error you found in TAOCP, he'll send you a check for $1 -- he used to do that, anyway. People tend not to cash the cheque, but keep it.
People often frame the cheque to put it on the wall.
I've read he stopped doing this because scumbags copied his account information from an image of a check.
I have no idea if this is current info, but Don Knuth's website describes what happened. He now issues checks from the fictional Bank of San Serriffe [0].

This line is classic Knuth:

  only 9 of the first 275 checks that I've sent out since the beginning of 2006 have actually been cashed. The others have apparently been cached.
0: https://www-cs-faculty.stanford.edu/~knuth/news08.html
That's the current info, though it sounds like he didn't always do that:

> Knuth offers monetary awards to people who find and report a bug in TeX. The award per bug started at US$2.56 (one "hexadecimal dollar"[41]) and doubled every year until it was frozen at its current value of $327.68. ... Due to scammers finding scanned copies of his checks on the internet and using them to try to drain his bank account, Knuth no longer sends out real checks, but those who submit bug reports can get credit at The Bank of San Serriffe instead.

(https://en.wikipedia.org/wiki/TeX - this is about TeX, though most of it is generic over all his various cheque schemes: https://en.wikipedia.org/wiki/Knuth_reward_check)

> I'm currently going through TAOCP[1].

When someone without a formal CS career is asking for a CS fundamentals book and you're dropping TAOCP I'm not sure if this is a humble brag or an attempt at trolling.

I don't have a formal CS career either. In one of the other comments someone wrote they read it being a high school dropout. Different people like different things. Note also that submission author studied chemistry, so they did get their fair share of training in mathematics.
And we are all very impressed. However, it's obvious how this set of books would intimidate mainstream non-exceptional folks (unlike yourself and the other person on this thread) from pursuing CS. I mean sure, different people like different things, but this piece of scientific literature is both very talked about and very little read as opposed to other, more distilled and popular sources of education. Sources which, due to solely their popularity, would have a lot more people around to help you when you're having trouble making progress.

Not saying these are bad books, they're actually brilliant (even with a couple of errors in the exercises). But with my (teeny tiny very little) teaching background, it's probably at the bottom of the list of things to recommend to someone just starting to look at CS fundamentals. Skiena's book would probably be my first choice.

> but this piece of scientific literature is both very talked about and very little read

Rightly said.

I am quite sceptical of people claiming they have "Read" Knuth's TAOCP; Browsed? Yes but Read/Studied? Not easily convinced. But perhaps i am just being too prejudiced and cynical.

Hm - I've read all three books and even tried working the exercises... I can't say I'd recommend TAOCP to somebody who's looking for a book on the fundamentals of CS. The books are fascinating, don't get me wrong, and I recommend every programmer read them, but they go way too deep into minutiae, while simultaneously ignoring other important topics to be useful as an introduction.
Agreed. I like that there are so many resources for people who want to learn how to program to hit the ground running. Some of the classic textbooks are wonderful for going back and filling in knowledge gaps. I'm at a point in my career where Dover's old proof-based math books start making sense. TAOCP is similar. If you already know the subject matter being covered, you'll have a lot of "Oh THAT'S why it works that way!" moments.
Interested in what gets suggested here...

There are a lot of "CS Course Online" type suggestions posted on HN, which are great - but for those of us with full time jobs and lives it's just a non-starter to approach that quantity of material.

I'm also more of a hands on learner which is how I got to where I am - but at the same time I can appreciate and happily absorb a well written, thoughtful book... In other words, I only have time for high quality, and high information density.

My meta suggestion in answer to the author: Not to downplay the utility in general CS knowledge and fundamentals, but you already sound like you are driven and have a direction - I recommend you ride that wave and buy books or seek out material that's more specific and relevant to what you are doing right now. You will soak it up so easily when you have something right in front of you to apply it to or think about - it's an opportunity, you will work on different things throughout your working life and this opportunity may pass. Personally, I have found CS fundamentals work their way to the surface through research into these more domain specific things - although I still recognise I could have much better awareness if I tackled it head on as you are suggesting.

I'll second this -- just hack on things that motivate you and you'll learn along the way. But working through at least the first third of an algorithms course will pay dividends if you're doing stuff with VR. Fortunately you can do these in parallel -- work through one lecture or a half lecture of "broccoli" and then go back to the meat and dessert of domain-specific hacking/reading until you're ready for more veggies.
I want to underscore this suggestion for another reason: computer science isn't one thing, but a whole host of related disciplines. I think of medicine as an analogy. Even if someone wanted "the basics", and you ask 10 computer scientists, you might get different answers. Turing machines? Automata? Compilers? Algorithms? Solve time?

What we tend to think of as "basics" happen to be what the problems were 50 years ago in computer science. If you don't have machines, you study the theory. If you have a very simple machine, you study the solve time (big O notation type stuff, although with exponential growth that is becoming more, not less, important).

All this is to say if you want to study VR/AR, perhaps the most important aspect is the relationship between the view angle, and the object. You would need to know linear algebra, transforms, the effect on the viewpoint and so forth. Linear algebra is one version of "the basics".

Thank you for the great comment. I see what you're saying with regards to focusing on domain specific material instead. I'm leaning towards one of the CS algorithms books suggested here + perhaps the 3D Math Primer book: https://gamemath.com/
Based on the description you give, you probably want a Data Structures/Algorithms intro.

The canonical Algorithms textbook is Introduction to Algorithms by Cormen et al. The MIT OpenCourseware course on Algorithms -- which includes videos and assignments -- follows along with that book: https://ocw.mit.edu/courses/electrical-engineering-and-compu...

Note: In your case, I'll recommend against SICP as a first resource, which is mentioned in some other comments. It's more of an introduction to functional programming. From your description, I'm not sure you need an intro to programming. And functional programming in particular is not really on the critical path of knowledge you'll need to muck about in VR land. It's not irrelevant, but it's not the critical path. An algorithms course probably is indispensable for that endeavor, though.

By all means, read SICP if you'd like. It's a great resource. But if you're trying to get from "I can program" to "hardcore hacking on VR stuff", step 1 is probably a decent algorithms course taught in the imperative style.

Note that a 4th edition of this book (frequently referred to as CLRS) is coming out sometime early next year.
Grokking Algorithms is also a good quick read in this space. It's a high level "here are some things you should know about and how they might be used" which exposes the reader to important algorithms and patterns without going too deep.
CLRS truly is the canonical way to learn algorithms at most top CS institutions. I can't upvote this enough.
CLRS is great, no doubt about it, but I think Sedgewick is probably friendlier to someone studying on his or her own. Note that there are several versions of Sedgewick, which use different languages (I think there are at least C, C++, and Java versions).

I'd go with Sedgewick, then get CLRS and Knuth for use as reference material.

Agreed. Are you aware of any recorded lectures / assignment sets for a course based on Sedgewick? I tend to suggest CLRS because the OCW lectures are so high-quality and most learners want at least the option of watching lectures.
Yes, I'm not sure that CLRS "Introduction to Algorithms" is approachable for everyone without prior exposure to formal CS concepts, notation, etc. My undergrad CS curriculum used "Algorithms in Java" by Sedgewick during our freshman year while we learned to write our first programs. We didn't use CLRS until a more in-depth algorithms class during our junior year. I read much more of CLRS in a graduate-level algorithms class.
If I had to learn algorithms again, and especially if I had to self-study the topic, I would personally choose a somewhat lighter textbook as an entry point, and then use CLRS for more rigor when needed. I used Skiena's excellent book for this purpose, but Sedgewick's might also be a good option. Note that Skiena doesn't cover all the topics in CLRS, but you should find most of it in there. But what you DO find is a much entertaining and motivating read.
I was lucky enough to have Cormen teach my algorithms class in school as well as a few other courses. He is a phenomenal teacher.
So my problem with CLRS is that a lot of the content is in the exercises. There are places in the text where it says, "refer back to solution to problem 34", etc. The problem is, there are no answers to exercises to be found - and the exercises are so open-ended there's no way to check to see if you actually got the right answer or not. IMHO, CLRS (or any educational text that doesn't make exercise answers available) is one of the worst options for self-study.
i recall finding some published solutions manual to the book 7-8 years ago when in college
Bottom up cs is a great resource. https://www.bottomupcs.com/ It might feel very low level at first but once you understand these fundamental building blocks of computers you will be really well equipped to build upon this knowledge and learn higher level concepts. I also think the Rust Programming book (https://doc.rust-lang.org/book/) is a great resource for general programming knowledge. Some sections e.g. on the borrow checker and lifetimes aren’t 100% applicable to general programming knowledge but I still recommend it. It is more of a 201 level book instead of 101 though.
That website is poorly named. It's not about computer science any more than a resource on anatomy is about medicine.
For formal resources:

You might like the Princeton Algorithms Coursera course: https://www.coursera.org/learn/algorithms-part1

SICP is an amazing book, but I HIGHLY recommend you follow along with a lecture video as the textbook was designed to go along with lectures for electrical engineering computer science students. Brian Harvey's lectures are fantastic: https://www.youtube.com/watch?v=4leZ1Ca4f0g&list=PLhMnuBfGeC...

And maybe some math? All of this is kind of abstract to start out with. It might be useful to combine this with youtube videos on your project, because you may be discouraged with doing a lot of abstract work and not concrete work on your project.

Also, freecodecamp and youtube in general is an excellent resource if you're stuck on any particular part of CS. Freecodecamp has compiled a lot of the best videos across the internet on particular concepts and you can get a deep dive into a topic if you're ever stuck. Nowadays, if you're stuck, often viewing someone else's explanation can get you unstuck fairly quick.

Harvey also has his own book, which is sort of an "intro to SICP". Available free online:

https://people.eecs.berkeley.edu/~bh/ss-toc2.html

I've found Harvey's lectures do a little too much, and risk less motivated students missing the forest for the trees. In my experience, SICP really focuses on the core points and belabours them until it's 100% sure you got it.
Structure and Interpretation of Computer Programs, by Abelson, Sussman, and Sussman.

Also known as "The Wizard Book" or "SICP".

The full text is legally available online[1], but I found it worthwhile to buy a copy.

There are at least two really good sets of video lectures to go with it if you are so inclined. Personally I enjoyed the ones from Berkeley.

[1]: https://mitpress.mit.edu/sites/default/files/sicp/index.html

For my CS degree, the two classes that were most useful foundations-wise were:

1. Learning how to prove things with math

2. "Baby compilers" machine code, building an assembler, building a simple MIPS compiler, regular expressions, parsing, etc

There's a lot of other topics but those two really set the foundation. All algorithms class and data structures are best understood with a mathematical intuition. Not to mention you want to go into VR, lin alg might help you.

YMMV. Lots of great programmers don't have a math background, but for me that helped.

The CLRS book is pretty standard (but mathy).

You'll learn things as you work too so don't discount patience.

As far as math proof books go.. I'd just check the library for something which covers stuff like truth tables in the 1st chapter and then lots of proof strategies (induction, breaking down by cases, contrapositive, proof by contradiction) with exercises. And find somebody to correct your mistakes which you will make XD
> All algorithms class and data structures are best understood with a mathematical intuition.

It's funny, I like to say I program by intuition. Trying to go through algorithms now, many years after college, makes me realize some math shortcuts really help, and I no longer have an intuition for that.

Would love to hear an example if you can share more!
Also maybe formal and symbolic logic. I don't have a CS degree, but I had a class where we, as a class, created an entire analogue symbolic logic language from scratch and it's by far one of the classes that's had the most value for me when doing any kind of tech/dev work. No idea how/if that's approached in CS programs, though...
I haven't used it myself but have heard good things about the resources here - https://teachyourselfcs.com
Also haven't used it, but this link from there [0] regarding intro to CS-style discrete math proofs seems somewhat lacking.

There doesn't seem to be enough focus on teaching proof techniques, and skips straight to discrete math content.

Could be a decent beginner resource if combined with something that teaches proof techniques though.

EDIT: the MIT book also listed is actually good [1]

[0]: https://cims.nyu.edu/~regev/teaching/discrete_math_fall_2005...

[1]: https://courses.csail.mit.edu/6.042/spring17/mcs.pdf

This is a great list. The person who made it runs a school for CS fundamentals, and I've been taking classes there for about a year. I strongly recommend it: https://bradfieldcs.com
"Foundations of Computer Science" by Aho and Ullman might fit your bill. Its focus is more on the concepts and principles of computing rather than math-centric CS theory. http://infolab.stanford.edu/~ullman/focs.html

Another nontraditional intro to computing worth mentioning is "Structure and Interpretation of Computer Programs" by Abelson and Sussman(s). It teaches programming concepts using the Lisp/Scheme language (seldom used any more), but does so brilliantly.

"Think Python: How to Think Like a Computer Scientist" by Downey might provide the right mix of computing concepts and programming practice.

If you do want a traditional intro to CS theory, two books that cover that topic well are: "Introduction to the Theory of Computation" by Sipser, and "Introduction to Automata Theory, Languages, and Computation" by Hopcroft, Motwani, and Ullman.

Three very good books that introduce algorithms are: "Introduction to Algorithms: A Creative Approach" by Manber, "The Algorithm Design Manual" by Skiena, and "Algorithms" by Sedgewick and Wayne.

Remember that CS theory doesn't age, so buying a used early edition of a textbook should serve your needs just as well as an new up-to-date edition.

I second the recommendation for "Foundations of Computer Science." (and for the other books as well, but wanted to highlight it.)

For a second or third book, consider 'Algorithm Design Manual', Skiena. I find it more approachable than the MIT Intro to Algorithms.

Also, 'The C Programming Language' remains one of my favorites for a pragmatic approach to learning how to say things to a computer, a great balance to learning the theory. There's a reason 'Hello World' has become so widely known that it's a cliche. But there is plenty of great advice there no matter what language you're in.

K&R. It's short, quick to get through, and the exercises are great for beginner CS. At the end you'll have a good working knowledge of C, which will act as an excellent base to move into other languages/disciplines.
* The elements of computer systems

* The little schemer

* The c programming language (k&r)

Seconding the recommendation of The Little Schemer, especially as a beginner book. Very accessible and low time investment, but even as an intermediate programmer when I read it, I got a lot out of it.
Lots are recommending CLRS, but IMO it is way too dry and dense for a first course.

I taught myself algorithms with the Algorithm Design Manual by Skiena, and I strongly recommend it. The first half is an exposition on algorithms, and it is mercifully readable, fun, and short. The second half is a catalog of different algorithms. You don’t really read through it, but it is useful as a reference if you have a specific problem you’re trying to solve and you want a background on algorithms in that area.

A couple friends of mine in similar situations spoke very highly of The Imposter's Handbook (https://bigmachine.io/products/the-imposters-handbook/)

I have a CS degree and I still really enjoyed reading through the 1st ed. of the first volume. I haven't looked at what was done with the material since then.

I had a good relantionship with Segdewick's books, before being turned off by Cormen a few times. They are less math focused, and overall have a beginner friendliness to them. They won't take you by the hand an explain things like you are 5, but nevertheless they are more easy to digest.

Also as a non-popular opinion in this current age, I recommend you to learn how to implement your algorithms in C, rather than an easier to grasp programming language. Even if you are probably not not going to program in C in your future career, understanding how memory management works will give you an edge later.

Also given C's loose style, you will also get some skills in organizing your code in a language that doesn't impose a lot of obvious constraints to the way you write your code. You will be able to build your own conventions, and evolve them once you get more skilled. Seeing what others are doing is also important.

Good luck!

PS: Don't fall into the macro trap, you will never get out. (inside joke).

CS50 from Harvard on https://edx.org used to teach Computer Science using C and still might do so.
I've actually gone through CS50x, but I felt that was only a base introduction compared to a regular old CS curriculum
This was the book I used. It is more accessible yet interestingly some comments seem to characterize it as "beginner friendly" in a way that suggests it is less canonical. Make no mistake, if you learn the material in Sedgewick well you'd be light years ahead of 99% of your peers. It likewise provides depth and foundations for things like leetcode, thus far the majority of leetcode problems I've done were toy versions of things covered in the book.

On a more personal / subjective PoV, IMHO its just a much better book than the majority of the others. Its not as basic as Grokking Algorithms nor as interview focused as Cracking the coding interview. I would suggest the latter if you just want to be good at programming interviews.

Interesting, I was working through sedgewick course on Coursera, I hit a bit of a wall, it seemed like one of the assignments was just really badly explained. However lots of other students were fine so it's probably me. I considered getting the grokking booking instead.

What's the main difference between sedgewick and the grok algo book?

Do you remember which assignment? I did the first one, percolation and hooo boy, that was a trip. The problem statement buries the key library that you use for everything at the bottom of the page. Did get it eventually though.
Hi, yeah week 3 collinear points, I had to post a number of questions on the message board due to language being ambiguous. In the end I could only get 74 percent and I had no idea why. I spent hours and hours and hours on it.

Yes percolation was a tough first assignment.

Week two was linked lists and really straight forward.

Also I found Sedgwick's explanations too terse, I ended up on YouTube countless times watching other videos that helped me get what he was saying.

I think it's probably me though, it's a Princeton course so I guess it's aimed at the very bright!

I’ll sort of second this by saying that Sedgewick’s Algorithms I/II courses on Coursera are top-notch and completely free. He is a truly thoughtful educator.

Completing those courses was probably the most useful thing I did when prepping for interviews as part of a career change 6 years ago.

Awesome!! Any other tips you have for someone going through that career change as well? I have a Mathematics BA, and worked as an actuary. I've self taught myself varying degrees of SQL, Python, JavaScript, and C, but I've found it difficult not to feel like an imposter without formal qualifications, even though I know I'm a capable learner and love solving challenging problems.
Software dev is a trade, not a science. With a math degree and stats work experience, I'd say you're better qualified as far as credentials than most of us professional devs.
I came from math as well! For what it’s worth, I’ve found that even the brightest computer scientists and software engineers have a solemn respect for mathematics.

Don’t worry about formal qualifications. This is an industry where the largest and most successful companies were started by college dropouts. It’s still very young and things are changing faster than academia can keep up. A willingness to learn and relearn is critical.

My prep for big tech interviews basically boiled down to those algorithms classes, doing ~150 leetcode problems, slapping together a small junky android app, and perusing undergrad CS material on Wikipedia. To be honest, the first two are probably enough to get your foot in the door at the biggest companies.

Discrete math is to Computer Science as Calculus is to Physics. If you still remember any discrete math from your Math BA, you should have zero issue consuming any undergraduate textbook on theoretical CS.
There are various approaches to becoming a good Software developer, and to be honest I think math fundamentals are as important as algorithmic foundations, which you can probably also pick up quite well with your background.

The one major difference (it is a tendency, not absolute) between software devs who came from CS and those that changed careers into it is a deep passion for computers and how they work. Look at HN, there's a lot of talk about Lisp, Assembly, C etc. although few people actually need it for their jobs. Dealing with these things usually comes from a place of passion more than a place of necessity, and they do make you a better dev, too.

A book I can warmly recommend if you want to see how deep your own interests go is "Principles of Programming languages" by MacLennan. He takes a historical approach, explaining the design principles of programming languages by looking at historically game-changing programming languages that few people still use today. The exercises get progressively more complex, and the last exercise is to design and implement your own programming language, a task I haven't yet done myself.

I like how Segdewick's book comes with working examples in java, which feels very approachable for a practitioner. In comparison, Cormen's book has lots of pseduo code examples where the indexing is 1 based. Cormen lays out the reasoning for this early in the book, how 1 based indexing is clearer for teaching, which sounds completely reasonable but is an additional hoop to jump through when trying to build working examples of the algorithms.
I'm a big fan of Sedgewick's books myself. I like how he has parallel series of his books, for different programming languages. So you get "Algorithms in Java" or "Algorithms in C++" or whatever, depending on your preference. I think he has at least C, C++, and Java versions.

https://www.cs.princeton.edu/~rs/

Do you know if there's much difference between these beyond the language used? It seems like he's only updating the Java version these days, and that's what is used in the Coursera course. From what I can tell he's collapsed it down to just a java version entitled "Algorithms" that hit 4th edition in 2011.

I'd rather have the exercises / examples in C but not if it means swimming upstream.

It's funny, I have each book of all three of the respective original series: Java, C, and C++. But I have never sat down and done a "side by side" comparison. And I've mostly worked through the Java version. I guess I had assumed that the contents were largely the same modulo language oriented variations, but I can't swear that that is the case.

From what I can tell he's collapsed it down to just a java version entitled "Algorithms" that hit 4th edition in 2011.

I never got around to picking that one up, so I don't really know anything about it.

”Code: The Hidden Language of Computer Hardware and Software” by Charles Petzold.

It will take you on a journey from a lightbulb to assembly language. It’s extremely well written and I wish there were more books like it.

Literally the perfect place to start.
Second this. A great book for understanding how computers work at a low level.
Not a book but https://teachyourselfcs.com/ if you want typical curriculum and also not a CS book but good book "Computer Science Fundamentals" (sneaky title, free online).

Although I recommend starting from "Code: The Hidden Language of Computer Hardware and Software". Coolest book ever.