I suggest that you work patiently through a good text on algorithms and data structures that has code samples in it. I recommend "Algorithms I and II" by Sedgewick or "Data Structures and Algorithm Analysis in Java" (or the C++ version) by Weiss. I also hear good things about "Data Structures and Algorithms in Java" by Lafore.
The above books are quite apt for beginners. You should expect to struggle a little but you must persevere anyway. I remember struggling with sorting and matrix multiplication algorithms when I learned it the first time in school. Do not mistake your unfamiliarity with the subject for its inherent difficulty! Once you write a few sample programs and see how the algorithms play out, you'll get the hang of it.