Introduction to Algorithms, 3rd Edition (MIT Press)

Category: Programming
Author: Thomas H. Cormen
All Stack Overflow 54
This Year Reddit 59
This Month Reddit 8

About This Book

Some books on algorithms are rigorous but incomplete; others cover masses of material but lack rigor. Introduction to Algorithms uniquely combines rigor and comprehensiveness. The book covers a broad range of algorithms in depth, yet makes their design and analysis accessible to all levels of readers. Each chapter is relatively self-contained and can be used as a unit of study. The algorithms are described in English and in a pseudocode designed to be readable by anyone who has done a little programming. The explanations have been kept elementary without sacrificing depth of coverage or mathematical rigor.

The first edition became a widely used text in universities worldwide as well as the standard reference for professionals.

The second edition featured new chapters on the role of algorithms, probabilistic analysis and randomized algorithms, and linear programming.

The third edition has been revised and updated throughout. It includes two completely new chapters, on van Emde Boas trees and multithreaded algorithms, substantial additions to the chapter on recurrence (now called "Divide-and-Conquer"), and an appendix on matrices. It features improved treatment of dynamic programming and greedy algorithms and a new notion of edge-based flow in the material on flow networks. Many new exercises and problems have been added for this edition. As of the third edition, this textbook is published exclusively by the MIT Press.


by Hermitian909   2022-05-10
What are your goals? I don't mean to be snarky when I say that learning to ask a structured question (or being more disciplined about asking them) should be high on your priority list. Book like the pyramid principle about top down communication would probably be helpful.

1. It's probably fine. Based on your self-description, based on your self-description I imagine you're still struggling with syntax and program structure. Programming in either language will improve your abilities in that regard and let you focus more on the underlying ideas in your classes. That said, if you can stick to 1 or 2 languages for most of your CS classes that is preferable.

2. Data Structures and Algorithms is useful, how useful depends on your goals. If you want to make the big bucks you should aim to be fluent in at least a textbook's worth of material. If you don't feel the need to aim for the top, you can get away with less. I would start with Skienna:

If you really want to be a master, you can then go for CLRS:

3. This depends on your goals. If you're aiming to be a top engineer now's one of your few chances to really focus in on lower level system stuff: Operating Systems, Networking, Compilers, or Databases. If you want a decent job fast of college, focus on data structures and algorithms and start trying to deploy code on something like digital ocean. That said you probably also want to do:

General advice: Dive deep, understanding a few things really well is better than understanding many things shallowly (you will retain more info over time).

A mistake many people make when reading textbooks is to guess what words mean. In technical texts this usually leads to misunderstandings and ultimately a slower learning process. Take the time to understand the words even if it takes hours (imminent deadlines notwithstanding), you will go faster. (I once took a month to get through a single page of a textbook because it had so many new words and concepts).

Start using version control (preferably git). Try to at least every hour if you have new code.

Try to start writing well structured code now. You probably won't do a great job at first but by trying earlier you'll do better.

Related to above, start writing tests for your code. Code that is testable is usually better structured.

Source: Senior engineer at one of the bigger tech companies and a former educator.

by roeles   2022-03-12
I think a popular book is this one:

However, it was too mathematical for me. I prefer this book that I bought in for a University course on Algorithms, Data structures and complexity:

by cletus   2022-01-03
The most important thing here is if you're asking this question right as you finish college and this is your goal, then you're screwed up.

Why? Because resume-building for high-profile employers begins long before graduation. Probably the most important factor: internships. Getting an internship is the highest-probability way of getting an offer bar none. If you don't have 1 or preferably 2 internships under your belt then you've made a mistake.

The second is that passing interview loops is a skill. It's one that can be studied for, learned and practiced. And if you're serious about this then you should do that. Many recommend CLRS [1] as a source for this. Personally, my choice would be Skiena [2]. Go through all the chapters on sorting and searching, lists, trees, graphs and possibly dynamic programming (some employers use this in interviews, some don't). Backtracking is useful but I've never seen it in an interview.

Do the same problems on an actual whiteboard. Don't just think about it. Get comfortable enough with any popular language (eg Javascript, Python, C/C++, Go, Java) such that the syntax and common libraries are second nature.

It's not unsalvageable to do this at the end of college (if that's the case). You just need to commit a few months to it.

Some will ask "why FAANG?" and the answer is obvious: the money can be life-changing but even aside from that it's an opportunity to learn a lot and having that on your resume is amazing social proof that will quickly eclipse the value of going to a top-tier school.



by gjkood   2021-12-12
Have you tried some of the old "Graphics Gems" series books yet? [1], [2], [3] They are not CS fundamentals but will help you out with the necessary concepts, math and algorithms for graphics programming and ray-tracing.

As others have mentioned any books on Data Structures & Algorithms are a must. [4], [5], [6]

However in my opinion, trying to understand CS fundamentals without undergoing some sort of formal education is a chore. You won't know what you are missing. Going through an established approved syllabus will give you a fuller understanding. But that is only if you are interested in the long haul.

There are a number of MOOCs that may fit the bill allowing you to slowly gather the knowledge without sacrificing too much time and focus on a day job to keep you going. I feel they are also great value for money for what you get. Some of them are from very reputable names if that is important. [7][8].

Since you have a B.Sc you can do the Masters level but there are also Bachelors level courses. [9]










by rockinghigh   2021-12-10

You're essentially asking for a computer science class on algorithms. I would recommend:

  • MIT Introduction to algorithms
  • Algorithms - Jeff Erickson (PDF)
  • Introduction to Algorithms book
  • Algorithms book from Sedgewick
by lbkulinski   2021-12-10

I am a big fan of Introduction to Algorithms. It covers a lot of content, and does it well!

by xsobolx   2021-12-10

Yes, this is good books


I can recommend this books instead Sedgwick

Or if you go further

Also see this

by jkingsbery   2020-07-18
Early in my career, I interviewed at Google. One of the interviewer asked me to recite the algorithm for constructing a Convex Hull. Since I hadn't done anything related to convex hulls since my algorithms class as a sophomore in college (several years earlier), I couldn't remember all the details. At some point, I said, I know where in CLRS ( this is. The interviewer didn't like this, so he said "Pretend you're an engineer at Google. You need to have a convex hull. What do you do?" And I said probably the most correct thing I've said in any interview: "I would go look it up." He really didn't like this answer, but we struggled together for an hour, with him frustrated that I couldn't remember the details of an algorithm I last had seen 6 years earlier and couldn't recite in 60 minutes what took our professor 180 minutes of lectures to cover, and me frustrated that would have taken me 30 seconds to look up.

I did not get the job at Google.

I do make sure as a more senior engineer at my current company I use what leverage I have to make sure other interviewers don't ask pointless questions like this.

by lancefisher   2019-12-18
These are great suggestions!

A few years ago I worked through building a spreadsheet in JavaScript. It was a great introduction to interpreters. I read through Writing an Interpreter in Go by Thorsten Ball [1]. Constraining the interpreter to execute formulas in cells was a straight-forward way to approach building one from scratch.

Writing a Pratt parser as part of this forced me to understand how it works. Figuring out how to process a sheet led me into algorithms and structures like directed acyclic graphs (as mentioned in the article). I found myself referencing Introduction to Algorithms and really studying it [2].

In the end I turned it into a talk at Big Sky Dev Con in Montana. The whole thing was a good experience - from researching how to do it, to sticking it out through the implementation, to distilling it to a 45 minute talk. Be sure to check out the recording [3] and code [4] if you're interested.

Any of these suggestions will lead you down a rabbit hole of learning with a clear objective in sight to keep you motivated to dig deeper.




by WeirdMexican1   2019-11-17

I was just finished my courses from my math degree, so I started reading Introduction to Algorithms, and totally change the things I want to do.

I learned that in my university the people that work in algorithms work in Computation Geometry and Data structures. Where can I find a master in algorithm desing thats is best suited for a matematician and what other themes are studied. I´m don´t know anything about this field of math and computer science.( Only for what I read)

by richi10820   2019-11-17

When I took the class we used this textbook which helped me a lot. Also, for practice problems I usually went to leetcode or geeksforgeeks (for example I used this for dynamic programming practice). Hope it helps!

by hextree   2019-11-17

Well it's been almost a decade since I read them, so I may not be the most up-to-date source. Introduction to Algorithms is a solid choice and gets mentioned a lot here. After you've understood the fundamentals, Skiena's Algorithm Design Manual is a good next step. It covers more advanced design theory, in particular there are some descriptions of real-life case studies and how Skiena approached them with algorithms design.

For Theory of Computation (Turing Machines, P vs NP, etc), I used Computational Complexity: A Modern Approach, because the draft is free on their website. It's pretty comprehensive and has a good selection of exercises. It's a draft though, so has a few typos or incomplete bits. Certainly companies aren't going to ask you questions about advanced theory, but the way I see it, if you can get through this book then you'll have mastered any Big Oh questions.

Alongside all that, Leetcode and Hackerrank are certainly great to test your knowledge practically. I practise them occasionally (I much prefer Hackerrank's interface and consistency), I just don't go overboard with grinding.

A more 'competitive coding' oriented book I've been looking at recently is: It has a few problems set at a far more advanced level than Leetcode.

by Fizz-Buzzkill   2019-11-17

Tom Cormen co-authored it also. He's one of the authors of the famous textbook Introduction to Algorithms

by BICHO_CHICKEN_   2019-11-17

Unless you're gifted with coding and algorithms, don't expect to be able to land an interview and then land a job. Interviews will test you on algorithms, and coding.

If I were you, I'd just focus on learning Java syntax very well, then move on to OOP principles, and then move on to MVC principles.

Assuming you already have the required math background, you need to open this book, and starting going through the important parts in each chapter, and committing it to memory. You will be tested on things from this book during job interviews. You are expected to code them as well. Amazon specifically ask about Linear Programming whereas Google might ask about other stuff.

Not many make it without a CS degree. I have made a few bucks selling game apps, but there is always better things to do out there.

Algorithms book, considered to the holy bible in CS

Start using Java, and commit things to memory.

You will need at least 9 months of prep time.

Use this book to learn java

Use this other book as well:

I assume you already know how to study and memorize and take good notes.

To get started on making game apps, visit this, and download it, it may help to fund you

by Lapompaelpompei   2019-11-17

There are many courses on the internet. Coursera, Udemy, etc.. I recommend you to read at least a book about it. It really helps you to understand the logic and complexity. For data structures, I also recommend you to implement them by your self.

This is a very good book:

This is the full MIT course:

I strongly recommend you to follow the course and read the book.

by pietremalvo1   2019-08-24

Best book: Introduction to Algorithms

It goes through data structures, algorithms and their cost (time, space etc..)

by forzrin   2019-08-24

It was a few years ago, but lots of entire series of lectures are online. I got through most of the "core" CS concepts in ~2 years of doing intense academic learning alongside actually writing code (and releasing some stuff to small groups or to app stores). Picking straightforward, small projects with a specific academic challenge like a game with a simple concept but needs pathfinding algorithms (and implementing them myself instead of using a framework)

e.g. Data Structures (YouTube)

You can also find series of lectures like the above on algorithms. Than do basic research on what the most common/industry standard textbooks for these topics are, like Introduction to Algorithms (Amazon link) and buy them or download PDFs or whatever.

The important thing is to actually do the work, suggested tasks/projects, etc. Personal accountability is the driver, here.

Then there are one off books like Code: Hidden Language (Amazon link) that explore specific topics or walk you through certain ideas and concepts at a kind of introductory level. If you find the topic interesting or it is important for your work, it's a good starting point to learn about the lowest level stuff.

by panicClark   2019-08-24

Io lavoro come sviluppatore ormai da diversi anni, anch'io non laureato (o meglio, laureato lo sarei, ma in un ambito piuttosto distante dall'informatica).

Le difficoltà maggiori all'inizio le ho incontrate quando si trattava di andare un pelino oltre al "giocare col lego" con linguaggi e framework (rigorosamente di alto livello): i fondamentali di come funzionano le reti e i protocolli, le strutture dati e gli algoritmi. Il primo ambito sto ancora cercando di approfondirlo bene, per strutture dati e algoritmi all'epoca mi consigliarono Introduction to Algorithms e devo dire che mi ci sono trovato abbastanza bene, seppure l'ho trovato noioso da seguire.

Mi è tornato relativamente più utile approfondire i linguaggi funzionali. Il classico in tal senso è Purely Functional Data Structures, ma a me è piaciuto di più Functional Programming in Scala.

by drchlt   2019-07-21

El de Cormen es uno de los que más se usan a nivel de postgrado.

Por mucho es lo más completo qué hay.

Edit: aquí está

by jaimeandresb   2019-07-21

Cormen’s intro to Algorithms. A classic