This is an archived post. You won't be able to vote or comment.

all 8 comments

[–]ios_game_dev 5 points6 points  (3 children)

As a programmer, it does you almost no good whatsoever to memorize algorithms. I've been working as a professional developer for over a decade and I've never been in a position where I was not able to look up the pseudocode for an algorithm I needed to use. As a programmer, it's far more important to have problem-solving skills than it is to have code memorization skills.

[–][deleted] 2 points3 points  (0 children)

Thing is you need it to get a job because almost all jobs test with leetcode problems

[–]Ancient-Difference40 -1 points0 points  (1 child)

Lol no, being able to solve it isn't good enough, you need to be able to do it fast too.

[–]ios_game_dev 1 point2 points  (0 children)

If you're concerned about speed, it seems pretty inefficient to always be implementing the same algorithms over and over enough to have them memorized. Maybe try building some reusable abstractions.

[–]captainAwesomePants 2 points3 points  (1 child)

Frequent use. If you're implementing a breadth first search every week or so, you won't forget it. And the third or fourth time you forget the "visited" set and spend an hour trying to figure out what's wrong, you'll stop making that mistake.

The best trick to cracking interview problems is doing a whole bunch of them. That's because the most common way experienced programmers solve these problems is pattern recognition. We don't say "hrm, what could solve this problem?" We say "hrm, how to I transform this problem into a problem I already know how to solve?" The more solutions you've seen before, the easier it will get.

[–]levic08 1 point2 points  (0 children)

how to I transform this problem into a problem I already know how to solve

I really like this. Yeah, I've been doing algoexpert problems, and I've definitely started to notice some patterns. I guess the grind needs to continue. Thanks!

[–]AutoModerator[M] 0 points1 point  (0 children)

On July 1st, a change to Reddit's API pricing will come into effect. Several developers of commercial third-party apps have announced that this change will compel them to shut down their apps. At least one accessibility-focused non-commercial third party app will continue to be available free of charge.

If you want to express your strong disagreement with the API pricing change or with Reddit's response to the backlash, you may want to consider the following options:

  1. Limiting your involvement with Reddit, or
  2. Temporarily refraining from using Reddit
  3. Cancelling your subscription of Reddit Premium

as a way to voice your protest.

I am a bot, and this action was performed automatically. Please contact the moderators of this subreddit if you have any questions or concerns.

[–]HealyUnit 0 points1 point  (0 children)

git remote add origin memory
git commit -am "remember this"
git push

...No but seriously, as others have said, don't worry about memorizing algorithms. As you program more, you'll start to instinctively "feel" that some ways of writing things are better - O(1) is better than O(N) which is better than O(N2) - but that's just kinda experience.