Understanding algorithms

October 31, 2023

This are the Steps i follow when i solve algorithms

First of and most importantly

  1. I try to understand the problem what input do i expect ?
  2. What are the given constraints?
  3. what Output is expected from me?

when i feel i do in fact understand the what the input , constraints and output are i then tell myself ,

  1. based on what i already know how can i approach this problem?
  2. Does this problem look Like Something that uses loops or recursion(trust me must problems require some kind of iteration)
  3. Is there any place certain decisons have to be made based on different inpute?
  4. What are the important calculations that would ensure i get my desired out put?
  5. i then try to construct each step mentally

Note: Depending on the size of the problem , i might choose to break it down into smaller problems or solve it as a whole(most questions that involve advanced DSA require some form of breaking down especcially if the are unfamiliar to you)

when i've satisfied all this cases i code

← Back to Blogs