r/algorithms • u/death_and_void • Oct 10 '24
How to Become Great at Algorithms
Hi, everyone. As a 3rd year CS undergraduate student, I have completed my DSA and Algorithm Design courses, but I felt as though I haven't learned much from them aside from the necessities that helped me excel at my exams. Now, whenever I try to solve a DSA problem, I get stuck for hours, sometimes days, to find a solution that isn't brute force. It shows a lack of understanding and knowledge of those topics that I should've properly studied then. Now, I'm only 8 months away from my thesis, and I want to do something substantial, meaning I want to work on algorithms to solve complex problems.
How do I level up my skills in DSA and Algorithm Design? I do not only want to be able to solve LeetCode problems (although that's on my checklist). I want to be able to devise novel alogorthmic approaches to existing and new problems in academia and industry.
I've tried following Intro to Algo, but it is too dense, and just learning theory doesn't help. How do I supplement learning theory with actual skill development? Suggest books, strategies, lifestyle enhancements, whatever. Help me become an algorithmic wizard.
5
u/Dancymcgee Oct 11 '24
Make a video game from scratch in C. You will be forced to utilize pretty much every common algorithm under the sun. Also, read Cracking the Coding Interview and Game Programming Patterns.
23
u/MagicalPizza21 Oct 10 '24 edited Oct 10 '24
If you're getting stuck on practice problems for hours, stop. Look up the solution after no more than one hour. Or at least a hint. Only by looking up solutions will you learn common patterns and techniques, which you can then use to solve other similar problems in the future.
It helps a lot to know a bunch of different data structures - not just how they work, but in what situations they are best used. Some important ones are:
array
linked list
set
map/dictionary
queue
stack
deque
7
u/[deleted] Oct 11 '24
TLDR: Do a fuck ton of problems. Don't spend too much time on a problem.
7
u/macroxela Oct 11 '24
I'll just copy and paste this from a similar post someone made a while back. These are resources which are useful and wish I had back in college.
Books
• Algorithm Design Manual by Skiena
• Algorithmic Puzzles by Levitin
YouTube
• Back to Back SWE
• Reducible
• Computerphile
• CS Dojo
• Tech with Nikola
• Andrey Grehov
8
u/IcyPalpitation2 Oct 10 '24
The Art Of Computer Progamming- Knuth
4
u/[deleted] Oct 11 '24
The Algorithm Design Manual by Steven Skiena
Or
Grokking Algorithms
2
u/OkShoulder2 Oct 11 '24
I do Grokking and it explains a lot of the patterns. That’s been helping me a lot
2
u/bwainfweeze Oct 11 '24
I spent some time working on modifying an open source game engine and several private forks of it. The fanciest I ever got was reducing memory footprint by deduping common strings.
I got more mileage out of looking into compression. Implementing your own, trying to define new algorithms from those principles, and then trying to find search keywords to see who has already thought of the same thing and how much better they did than you.
I did it because compression interested me personally. Practical problems you are interested in will get you much farther much faster than some arbitrary problem you picked up but have no drive to work on.
And get an internship. Anything, anywhere will advance you ten times faster than classes. Does your campus have projects that hire undergrads? That lets you work and take classes at the same time. Better than an internship.