Skip to content

Latest commit

 

History

History
19 lines (16 loc) · 1.34 KB

my_algorithms_design_techniques.md

File metadata and controls

19 lines (16 loc) · 1.34 KB
  • My Algorithm Design Techniques ================================
  • Divide the problem into buckets and then apply different algorithm depending on the size of the bucket or another criteria (also depending on which is more performant on the bucket size) and then merge the results
  • DP where you find a recursion relation between k-1 and k element and a way to merge them and find the best case.
  • checking if a problem can be modeled with a tree or a graph and if so if DFS or BFS can give us a solution.
  • complement of a sum
  • runner technique
  • storing in an array like leap year calculation trick of saving number of days untill each month
  • Use merge sort and complement it with some additional processing like used with inversion count
  • preprocess the data to make solving the problem on it easier like with a Trie
  • Storing whatever can help solve the problem in an array like done i KMP algo where we are storing the pattern position to compare against the next text position, or with array of number of days untill month like leap year problem
  • building an automata to comeup with a solution like in KMP
  • simplifying the problem and then trying to solve and once that is solved added the details and try to solve it again
  • using sliding window or just sliding or jumping by some intervals like used in Boyer-Moore or Boyer-Moore-Horspool algorithms.