How I Memorize with Understanding

Here are the steps I have been using to learn new algorithms, which is basically the same strategy as this.

  1. Pick a problem that shows up frequently in interviews from LeetCode
  2. Attempt to solve it
  3. After being stuck for too long, learn the ideal solution by doing the following steps
  4. Watch videos, i.e. Tushar Roy, Geeks for Geeks
  5. Read solutions from LeetCode especially the highest voted solutions
  6. Pick a solution and type it out. Add comments, change the variable names to names that are meaningful to me
  7. Attempt to solve this problem every day. What this really means is type out the solution every day until I either have it memorized and/or understand it so well that I don’t need to have it memorized, or some combination. Typing the code out every day is great because I am gaining exposure to the code feeling (typing), seeing, and hearing. I think this multi-sensory exposure also gets the information to my subconscious mind so it can spot patterns.

Doing this is key for certain common algorithms such as level-order traversal, iterative in pre and post order binary tree traversals, and also for understanding how to use recursion with base cases and recursive cases.

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s