While looking through some problems on CodeForces, I noticed that there were several problems that required knowledge of techniques that just aren't covered in standard algorithm texts.

Topics that I want to understand include

  • segment trees, least common ancestor, range-minimum query
  • Fenwick trees
  • heavy-light decomposition
  • interval trees
  • Hopcroft–Karp algorithm
  • implementations of tries
  • wavelet trees

There doesn't seem to be any book that comprehensively looks at any of those techniques. The only organized resource that I could find was a list of articles on GeeksForGeeks, but much of the site doesn't seem self-contained and linearly ordered the way a textbook would be. It's fine if not all of the techniques I've listed are covered, but I'd prefer a book that covered as much of it as possible. Any help?

  • $\begingroup$ quora.com/… $\endgroup$
    – Bulat
    Jul 19, 2018 at 0:38
  • $\begingroup$ I already have CLRS, and I don't think any of those books listed in that link have what I'm looking for. Judging from the table of contents, I'm pretty sure that they don't cover any of those three techniques I just listed in the question. $\endgroup$
    – W.Z.
    Jul 19, 2018 at 1:32
  • $\begingroup$ Can you state the requirements more precisely? Exactly what do you require the book to cover? Can you state it without an "etc"? It seems you want a book that covers all of some list but you haven't stated the list, so I don't see how this question can be answered in its current form. (A separate issue: there may be no one textbook that covers everything you want covered. That's just a fact of life.) You might also see our guidance on asking these kinds of questions: cs.meta.stackexchange.com/q/1312/755. $\endgroup$
    – D.W.
    Jul 19, 2018 at 1:36

1 Answer 1


Here are two books written especially for competitive programming:

  • "Guide to Competitive Programming", Antti Laaksonen:

    The book is based on the book "Competitive Programmer's Handbook" by the same author, which was already really good. This handbook is still available for free on the author's website. The commercial version is more comprehensive and contains more topics.

  • "Competitive Programming 3", by Steven Halim and Felix Halim:

    Pretty much the classic book for learning competitive programming. Maybe a little bit dated.


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.