To recognize patterns, a great resource is Steven Skiena's "Algorithm Design Manual."
After a few introductory/overview chapters, it launches into a dictionary of algorithms, organized by problem description. There are also pointers to implementations, but the focus is high-level descriptions of what sorts of algorithms for look for, and how to choose among them.
However, it was a much earlier edition and all the examples are in Pascal. Having to mentally convert the code from 1-based arrays to 0-based like any decent language has been a major pain over the years.