Saturday, March 26, 2016

Tips for approaching Algorithmic problems

  1. Exemplify (Investigation): Understand problem by creating minimum two examples of the algorithm. Use this step to create test-inputs.
  2. Algo Pattern: Identify the similar algorithms (or patterns of algorithms) that you've encountered previously. Use this step to identify best applicable data-structure. 
  3. Data Structure Brainstorm: This is hit and trial method. Try fitting relevant data structure till you find the best match. There are far better techniques for choosing it as well (watch this space and I shall update it shortly).
  4. Simplify and Generalize (Divide and Conquer): Break-down the big problem into smaller fragments. Use this step to modularize. 
  5. Base case and Build: Identify base case (eg. just one element case) for algorithm behavior and start from there. 
  6. Algo Features: Keep a check on sequence, decision, repetition and Asymptotic Complexity (Big O notation)

JVM Architecture